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

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