public function getParentContents(AbstractClassContent $content)
    {
        $result = $this->_em->getConnection()
            ->createQueryBuilder()
            ->select('p.parent_uid', 'c.classname')
            ->from('content_has_subcontent', 'p')
            ->leftJoin('p', 'content', 'c', 'p.parent_uid = c.uid')
            ->where('p.content_uid = :uid')
            ->setParameter('uid', $content->getUid())
            ->execute()
            ->fetchAll()
        ;

        $parents = [];
        foreach ($result as $parentData) {
            $parentData['classname'] = AbstractClassContent::getFullClassname($parentData['classname']);
            $parents[] = $this->_em->find($parentData['classname'], $parentData['parent_uid']);
        }

        return $parents;
    }
public function getParentContents(AbstractClassContent $content)
    {
        $result = $this->_em->getConnection()
            ->createQueryBuilder()
            ->select('p.parent_uid', 'c.classname')
            ->from('content_has_subcontent', 'p')
            ->leftJoin('p', 'content', 'c', 'p.parent_uid = c.uid')
            ->where('p.content_uid = :uid')
            ->setParameter('uid', $content->getUid())
            ->execute()
            ->fetchAll()
        ;

        $parents = [];
        foreach ($result as $parentData) {
            $parentData['classname'] = AbstractClassContent::getFullClassname($parentData['classname']);
            $parents[] = $this->_em->find($parentData['classname'], $parentData['parent_uid']);
        }

        return $parents;
    }
public function getParentContents ( AbstractClassContent $ content ) { $ result = $ this -> _em -> getConnection ( ) -> createQueryBuilder ( ) -> select ( 'p.parent_uid' , 'c.classname' ) -> from ( 'content_has_subcontent' , 'p' ) -> leftJoin ( 'p' , 'content' , 'c' , 'p.parent_uid = c.uid' ) -> where ( 'p.content_uid = :uid' ) -> setParameter ( 'uid' , $ content -> getUid ( ) ) -> execute ( ) -> fetchAll ( ) ; $ parents = [ ] ; foreach ( $ result as $ parentData ) { $ parentData [ 'classname' ] = AbstractClassContent :: getFullClassname ( $ parentData [ 'classname' ] ) ; $ parents [ ] = $ this -> _em -> find ( $ parentData [ 'classname' ] , $ parentData [ 'parent_uid' ] ) ; } return $ parents ; }
Returns provided content direct parents entity.

@param  AbstractClassContent $content The content we want to get its direct parents
@return array
Returns provided content direct parents entity .