public function assertValidChildClass(self $class)
    {
        if ($this->isLeaf()) {
            throw new OutOfBoundsException(sprintf(
                'Document "%s" has been mapped as a leaf. It cannot have children',
                $this->name
            ));
        }

        $childClasses = $this->getChildClasses();

        if (0 === count($childClasses)) {
            return;
        }

        foreach ($childClasses as $childClass) {
            if ($class->name === $childClass || $class->reflClass->isSubclassOf($childClass)) {
                return;
            }
        }

        throw new OutOfBoundsException(sprintf(
            'Document "%s" does not allow children of type "%s". Allowed child classes "%s"',
            $this->name,
            $class->name,
            implode('", "', $childClasses)
        ));
    }
public function assertValidChildClass(self $class)
    {
        if ($this->isLeaf()) {
            throw new OutOfBoundsException(sprintf(
                'Document "%s" has been mapped as a leaf. It cannot have children',
                $this->name
            ));
        }

        $childClasses = $this->getChildClasses();

        if (0 === count($childClasses)) {
            return;
        }

        foreach ($childClasses as $childClass) {
            if ($class->name === $childClass || $class->reflClass->isSubclassOf($childClass)) {
                return;
            }
        }

        throw new OutOfBoundsException(sprintf(
            'Document "%s" does not allow children of type "%s". Allowed child classes "%s"',
            $this->name,
            $class->name,
            implode('", "', $childClasses)
        ));
    }
public function assertValidChildClass ( self $ class ) { if ( $ this -> isLeaf ( ) ) { throw new OutOfBoundsException ( sprintf ( 'Document "%s" has been mapped as a leaf. It cannot have children' , $ this -> name ) ) ; } $ childClasses = $ this -> getChildClasses ( ) ; if ( 0 === count ( $ childClasses ) ) { return ; } foreach ( $ childClasses as $ childClass ) { if ( $ class -> name === $ childClass || $ class -> reflClass -> isSubclassOf ( $ childClass ) ) { return ; } } throw new OutOfBoundsException ( sprintf ( 'Document "%s" does not allow children of type "%s". Allowed child classes "%s"' , $ this -> name , $ class -> name , implode ( '", "' , $ childClasses ) ) ) ; }
Assert that the given class FQN can be a child of the document this
metadata represents.

@param string $classFqn

@throws OutOfBoundsException
Assert that the given class FQN can be a child of the document this metadata represents .