src/ORM/DataObjectSchema.php
public function belongsToComponent($class, $component, $classOnly = true)
    {
        $belongsTo = (array)Config::forClass($class)->get('belongs_to');
        if (!isset($belongsTo[$component])) {
            return null;
        }

        // Remove has_one specifier if given
        $belongsTo = $belongsTo[$component];
        $belongsToClass = strtok($belongsTo, '.');

        // Validate
        $this->checkRelationClass($class, $component, $belongsToClass, 'belongs_to');
        return $classOnly ? $belongsToClass : $belongsTo;
    }
public function belongsToComponent($class, $component, $classOnly = true)
    {
        $belongsTo = (array)Config::forClass($class)->get('belongs_to');
        if (!isset($belongsTo[$component])) {
            return null;
        }

        // Remove has_one specifier if given
        $belongsTo = $belongsTo[$component];
        $belongsToClass = strtok($belongsTo, '.');

        // Validate
        $this->checkRelationClass($class, $component, $belongsToClass, 'belongs_to');
        return $classOnly ? $belongsToClass : $belongsTo;
    }
public function belongsToComponent ( $ class , $ component , $ classOnly = true ) { $ belongsTo = ( array ) Config :: forClass ( $ class ) -> get ( 'belongs_to' ) ; if ( ! isset ( $ belongsTo [ $ component ] ) ) { return null ; } // Remove has_one specifier if given $ belongsTo = $ belongsTo [ $ component ] ; $ belongsToClass = strtok ( $ belongsTo , '.' ) ; // Validate $ this -> checkRelationClass ( $ class , $ component , $ belongsToClass , 'belongs_to' ) ; return $ classOnly ? $ belongsToClass : $ belongsTo ; }
Return data for a specific belongs_to component.

@param string $class
@param string $component
@param bool $classOnly If this is TRUE, than any has_many relationships in the
form "ClassName.Field" will have the field data stripped off. It defaults to TRUE.

@return string|null
Return data for a specific belongs_to component .