public function isChildOf($child, $parent)
    {
        $childMeta = $this->getMetadataForType($child);
        if (false === $childMeta->isChildEntity()) {
            return false;
        }
        return $childMeta->getParentEntityType() === $parent;
    }
public function isChildOf($child, $parent)
    {
        $childMeta = $this->getMetadataForType($child);
        if (false === $childMeta->isChildEntity()) {
            return false;
        }
        return $childMeta->getParentEntityType() === $parent;
    }
public function isChildOf ( $ child , $ parent ) { $ childMeta = $ this -> getMetadataForType ( $ child ) ; if ( false === $ childMeta -> isChildEntity ( ) ) { return false ; } return $ childMeta -> getParentEntityType ( ) === $ parent ; }
Determines if a type is direct child of another type.

@param   string  $child
@param   string  $parent
@return  bool
Determines if a type is direct child of another type .