public static function createSectionAssociation($parent_section_id = null, $child_field_id = null, $parent_field_id = null, $show_association = true, $interface = null, $editor = null)
    {
        if (is_null($parent_section_id) && (is_null($parent_field_id) || !$parent_field_id)) {
            return false;
        }

        if (is_null($parent_section_id)) {
            $parent_field = FieldManager::fetch($parent_field_id);
            $parent_section_id = $parent_field->get('parent_section');
        }

        $child_field = FieldManager::fetch($child_field_id);
        $child_section_id = $child_field->get('parent_section');

        $fields = array(
            'parent_section_id' => $parent_section_id,
            'parent_section_field_id' => $parent_field_id,
            'child_section_id' => $child_section_id,
            'child_section_field_id' => $child_field_id,
            'hide_association' => ($show_association ? 'no' : 'yes'),
            'interface' => $interface,
            'editor' => $editor
        );

        return Symphony::Database()->insert($fields, 'tbl_sections_association');
    }
public static function createSectionAssociation($parent_section_id = null, $child_field_id = null, $parent_field_id = null, $show_association = true, $interface = null, $editor = null)
    {
        if (is_null($parent_section_id) && (is_null($parent_field_id) || !$parent_field_id)) {
            return false;
        }

        if (is_null($parent_section_id)) {
            $parent_field = FieldManager::fetch($parent_field_id);
            $parent_section_id = $parent_field->get('parent_section');
        }

        $child_field = FieldManager::fetch($child_field_id);
        $child_section_id = $child_field->get('parent_section');

        $fields = array(
            'parent_section_id' => $parent_section_id,
            'parent_section_field_id' => $parent_field_id,
            'child_section_id' => $child_section_id,
            'child_section_field_id' => $child_field_id,
            'hide_association' => ($show_association ? 'no' : 'yes'),
            'interface' => $interface,
            'editor' => $editor
        );

        return Symphony::Database()->insert($fields, 'tbl_sections_association');
    }
public static function createSectionAssociation ( $ parent_section_id = null , $ child_field_id = null , $ parent_field_id = null , $ show_association = true , $ interface = null , $ editor = null ) { if ( is_null ( $ parent_section_id ) && ( is_null ( $ parent_field_id ) || ! $ parent_field_id ) ) { return false ; } if ( is_null ( $ parent_section_id ) ) { $ parent_field = FieldManager :: fetch ( $ parent_field_id ) ; $ parent_section_id = $ parent_field -> get ( 'parent_section' ) ; } $ child_field = FieldManager :: fetch ( $ child_field_id ) ; $ child_section_id = $ child_field -> get ( 'parent_section' ) ; $ fields = array ( 'parent_section_id' => $ parent_section_id , 'parent_section_field_id' => $ parent_field_id , 'child_section_id' => $ child_section_id , 'child_section_field_id' => $ child_field_id , 'hide_association' => ( $ show_association ? 'no' : 'yes' ) , 'interface' => $ interface , 'editor' => $ editor ) ; return Symphony :: Database ( ) -> insert ( $ fields , 'tbl_sections_association' ) ; }
Create an association between a section and a field.

@since Symphony 2.3
@param integer $parent_section_id
The linked section id.
@param integer $child_field_id
The field ID of the field that is creating the association
@param integer $parent_field_id (optional)
The field ID of the linked field in the linked section
@param boolean $show_association (optional)
Whether of not the link should be shown on the entries table of the
linked section. This defaults to true.
@throws DatabaseException
@throws Exception
@return boolean
true if the association was successfully made, false otherwise.
Create an association between a section and a field .