private function getRelatedContentItems(array $relatedContentIds, array $contentTypeIdentifiers)
    {
        if (count($relatedContentIds) === 0) {
            return [];
        }

        $criteria = new ContentId($relatedContentIds);

        if (!empty($contentTypeIdentifiers)) {
            $criteria = new LogicalAnd([
                $criteria,
                new ContentTypeIdentifier($contentTypeIdentifiers),
            ]);
        }

        $query = new Query([
            'filter' => $criteria,
            'limit' => count($relatedContentIds),
        ]);

        $searchResult = $this->site->getFilterService()->filterContent($query);
        /** @var \eZ\Publish\API\Repository\Values\Content\Content[] $contentItems */
        $contentItems = $this->extractValueObjects($searchResult);

        return $contentItems;
    }
private function getRelatedContentItems(array $relatedContentIds, array $contentTypeIdentifiers)
    {
        if (count($relatedContentIds) === 0) {
            return [];
        }

        $criteria = new ContentId($relatedContentIds);

        if (!empty($contentTypeIdentifiers)) {
            $criteria = new LogicalAnd([
                $criteria,
                new ContentTypeIdentifier($contentTypeIdentifiers),
            ]);
        }

        $query = new Query([
            'filter' => $criteria,
            'limit' => count($relatedContentIds),
        ]);

        $searchResult = $this->site->getFilterService()->filterContent($query);
        /** @var \eZ\Publish\API\Repository\Values\Content\Content[] $contentItems */
        $contentItems = $this->extractValueObjects($searchResult);

        return $contentItems;
    }
private function getRelatedContentItems ( array $ relatedContentIds , array $ contentTypeIdentifiers ) { if ( count ( $ relatedContentIds ) === 0 ) { return [ ] ; } $ criteria = new ContentId ( $ relatedContentIds ) ; if ( ! empty ( $ contentTypeIdentifiers ) ) { $ criteria = new LogicalAnd ( [ $ criteria , new ContentTypeIdentifier ( $ contentTypeIdentifiers ) , ] ) ; } $ query = new Query ( [ 'filter' => $ criteria , 'limit' => count ( $ relatedContentIds ) , ] ) ; $ searchResult = $ this -> site -> getFilterService ( ) -> filterContent ( $ query ) ; /** @var \eZ\Publish\API\Repository\Values\Content\Content[] $contentItems */ $ contentItems = $ this -> extractValueObjects ( $ searchResult ) ; return $ contentItems ; }
Return an array of related Content from the given arguments.

@throws \InvalidArgumentException As thrown by the Search API

@param array $relatedContentIds
@param array $contentTypeIdentifiers

@return \eZ\Publish\API\Repository\Values\Content\Content[]
Return an array of related Content from the given arguments .