src/ORM/DataObjectSchema.php
protected function parseBelongsManyManyComponent($parentClass, $component, $specification)
    {
        $childClass = $specification;
        $relationName = null;
        if (strpos($specification, '.') !== false) {
            list($childClass, $relationName) = explode('.', $specification, 2);
        }

        // Check child class exists
        if (!class_exists($childClass)) {
            throw new LogicException(
                "belongs_many_many relation {$parentClass}.{$component} points to "
                . "{$childClass} which does not exist"
            );
        }

        // We need to find the inverse component name, if not explicitly given
        if (!$relationName) {
            $relationName = $this->getManyManyInverseRelationship($childClass, $parentClass);
        }

        // Check valid relation found
        if (!$relationName) {
            throw new LogicException(
                "belongs_many_many relation {$parentClass}.{$component} points to "
                . "{$specification} without matching many_many"
            );
        }

        // Return relatios
        return [
            'childClass' => $childClass,
            'relationName' => $relationName,
        ];
    }
protected function parseBelongsManyManyComponent($parentClass, $component, $specification)
    {
        $childClass = $specification;
        $relationName = null;
        if (strpos($specification, '.') !== false) {
            list($childClass, $relationName) = explode('.', $specification, 2);
        }

        // Check child class exists
        if (!class_exists($childClass)) {
            throw new LogicException(
                "belongs_many_many relation {$parentClass}.{$component} points to "
                . "{$childClass} which does not exist"
            );
        }

        // We need to find the inverse component name, if not explicitly given
        if (!$relationName) {
            $relationName = $this->getManyManyInverseRelationship($childClass, $parentClass);
        }

        // Check valid relation found
        if (!$relationName) {
            throw new LogicException(
                "belongs_many_many relation {$parentClass}.{$component} points to "
                . "{$specification} without matching many_many"
            );
        }

        // Return relatios
        return [
            'childClass' => $childClass,
            'relationName' => $relationName,
        ];
    }
protected function parseBelongsManyManyComponent ( $ parentClass , $ component , $ specification ) { $ childClass = $ specification ; $ relationName = null ; if ( strpos ( $ specification , '.' ) !== false ) { list ( $ childClass , $ relationName ) = explode ( '.' , $ specification , 2 ) ; } // Check child class exists if ( ! class_exists ( $ childClass ) ) { throw new LogicException ( "belongs_many_many relation {$parentClass}.{$component} points to " . "{$childClass} which does not exist" ) ; } // We need to find the inverse component name, if not explicitly given if ( ! $ relationName ) { $ relationName = $ this -> getManyManyInverseRelationship ( $ childClass , $ parentClass ) ; } // Check valid relation found if ( ! $ relationName ) { throw new LogicException ( "belongs_many_many relation {$parentClass}.{$component} points to " . "{$specification} without matching many_many" ) ; } // Return relatios return [ 'childClass' => $ childClass , 'relationName' => $ relationName , ] ; }
Parse a belongs_many_many component to extract class and relationship name

@param string $parentClass Name of class
@param string $component Name of relation on class
@param string $specification specification for this belongs_many_many

@return array Array with child class and relation name
Parse a belongs_many_many component to extract class and relationship name