src/Models/CmsModel.php
public function getCmsReferenceKeyForRelation($relation, $reversed = false)
    {
        $isParent = (   array_key_exists($relation, $this->relationsConfig)
                    &&  array_key_exists('parent', $this->relationsConfig[$relation])
                    &&  (bool) $this->relationsConfig[$relation]['parent']
                    );

        if ($reversed) {
            $isParent = ! $isParent;
        }

        return $isParent
                ?   config('pxlcms.relations.references.keys.to', 'to_entry_id')
                :   config('pxlcms.relations.references.keys.from', 'from_entry_id');
    }
public function getCmsReferenceKeyForRelation($relation, $reversed = false)
    {
        $isParent = (   array_key_exists($relation, $this->relationsConfig)
                    &&  array_key_exists('parent', $this->relationsConfig[$relation])
                    &&  (bool) $this->relationsConfig[$relation]['parent']
                    );

        if ($reversed) {
            $isParent = ! $isParent;
        }

        return $isParent
                ?   config('pxlcms.relations.references.keys.to', 'to_entry_id')
                :   config('pxlcms.relations.references.keys.from', 'from_entry_id');
    }
public function getCmsReferenceKeyForRelation ( $ relation , $ reversed = false ) { $ isParent = ( array_key_exists ( $ relation , $ this -> relationsConfig ) && array_key_exists ( 'parent' , $ this -> relationsConfig [ $ relation ] ) && ( bool ) $ this -> relationsConfig [ $ relation ] [ 'parent' ] ) ; if ( $ reversed ) { $ isParent = ! $ isParent ; } return $ isParent ? config ( 'pxlcms.relations.references.keys.to' , 'to_entry_id' ) : config ( 'pxlcms.relations.references.keys.from' , 'from_entry_id' ) ; }
Get standard belongsToMany reference key name for 'from' and 'to' models
Reversed gives the 'to' key

@param string $relation
@param bool   $reversed (default: false)
@return string
Get standard belongsToMany reference key name for from and to models Reversed gives the to key