public function getContentsParentUids($contentUids)
    {
        $contentUids = (array) $contentUids;
        if (0 === count($contentUids)) {
            return [];
        }

        $contentUids = implode(', ', array_unique(array_map(function ($uid) {
            return '"'.$uid.'"';
        }, $contentUids)));

        $parentUids = $this->_em->getConnection()->executeQuery(
            sprintf('SELECT parent_uid FROM content_has_subcontent WHERE content_uid IN (%s)', $contentUids)
        )->fetchAll(\PDO::FETCH_COLUMN);

        return array_merge($parentUids, $this->getContentsParentUids($parentUids));
    }
public function getContentsParentUids($contentUids)
    {
        $contentUids = (array) $contentUids;
        if (0 === count($contentUids)) {
            return [];
        }

        $contentUids = implode(', ', array_unique(array_map(function ($uid) {
            return '"'.$uid.'"';
        }, $contentUids)));

        $parentUids = $this->_em->getConnection()->executeQuery(
            sprintf('SELECT parent_uid FROM content_has_subcontent WHERE content_uid IN (%s)', $contentUids)
        )->fetchAll(\PDO::FETCH_COLUMN);

        return array_merge($parentUids, $this->getContentsParentUids($parentUids));
    }
public function getContentsParentUids ( $ contentUids ) { $ contentUids = ( array ) $ contentUids ; if ( 0 === count ( $ contentUids ) ) { return [ ] ; } $ contentUids = implode ( ', ' , array_unique ( array_map ( function ( $ uid ) { return '"' . $ uid . '"' ; } , $ contentUids ) ) ) ; $ parentUids = $ this -> _em -> getConnection ( ) -> executeQuery ( sprintf ( 'SELECT parent_uid FROM content_has_subcontent WHERE content_uid IN (%s)' , $ contentUids ) ) -> fetchAll ( \ PDO :: FETCH_COLUMN ) ; return array_merge ( $ parentUids , $ this -> getContentsParentUids ( $ parentUids ) ) ; }
Returns all parents uid of provided contents.

@param  string|array $contentUids Contents' uid we want to get all parents uid
@return array
Returns all parents uid of provided contents .