lib/Backend/EzPublishBackend.php
private function buildItem(SearchHit $searchHit): Item
    {
        /** @var \eZ\Publish\API\Repository\Values\Content\Location $location */
        $location = $searchHit->valueObject;

        /** @var \eZ\Publish\API\Repository\Values\Content\Content $content */
        $content = $this->repository->sudo(
            static function (Repository $repository) use ($location): Content {
                return $repository->getContentService()->loadContentByContentInfo(
                    $location->contentInfo
                );
            }
        );

        return new Item(
            $location,
            $content,
            $this->config->getItemType() === 'ezlocation' ?
                $location->id :
                $location->contentInfo->id,
            $this->isSelectable($content)
        );
    }
private function buildItem(SearchHit $searchHit): Item
    {
        /** @var \eZ\Publish\API\Repository\Values\Content\Location $location */
        $location = $searchHit->valueObject;

        /** @var \eZ\Publish\API\Repository\Values\Content\Content $content */
        $content = $this->repository->sudo(
            static function (Repository $repository) use ($location): Content {
                return $repository->getContentService()->loadContentByContentInfo(
                    $location->contentInfo
                );
            }
        );

        return new Item(
            $location,
            $content,
            $this->config->getItemType() === 'ezlocation' ?
                $location->id :
                $location->contentInfo->id,
            $this->isSelectable($content)
        );
    }
private function buildItem ( SearchHit $ searchHit ) : Item { /** @var \eZ\Publish\API\Repository\Values\Content\Location $location */ $ location = $ searchHit -> valueObject ; /** @var \eZ\Publish\API\Repository\Values\Content\Content $content */ $ content = $ this -> repository -> sudo ( static function ( Repository $ repository ) use ( $ location ) : Content { return $ repository -> getContentService ( ) -> loadContentByContentInfo ( $ location -> contentInfo ) ; } ) ; return new Item ( $ location , $ content , $ this -> config -> getItemType ( ) === 'ezlocation' ? $ location -> id : $ location -> contentInfo -> id , $ this -> isSelectable ( $ content ) ) ; }
Builds the item from provided search hit.
Builds the item from provided search hit .