public function loadContentfulEntry(string $id): ContentfulEntry
    {
        $idList = explode('|', $id);
        if (count($idList) !== 2) {
            throw new NotFoundException(
                sprintf(
                    'Item ID %s not valid.',
                    $id
                )
            );
        }

        $client = $this->getClientBySpaceId($idList[0]);

        if ($client === null) {
            throw new NotFoundException(
                sprintf(
                    'Item ID %s not valid.',
                    $idList[0]
                )
            );
        }

        $contentfulEntry = $this->findContentfulEntry($id);

        if ($contentfulEntry instanceof ContentfulEntry) {
            $contentfulEntry->reviveRemoteEntry($client);
        } else {
            $contentfulEntry = $this->buildContentfulEntry(
                $client->getEntry($idList[1]),
                $id
            );
        }

        if ($contentfulEntry->getIsDeleted()) {
            throw new NotFoundException(
                sprintf(
                    'Entry with ID %s deleted.',
                    $id
                )
            );
        }

        return $contentfulEntry;
    }
public function loadContentfulEntry(string $id): ContentfulEntry
    {
        $idList = explode('|', $id);
        if (count($idList) !== 2) {
            throw new NotFoundException(
                sprintf(
                    'Item ID %s not valid.',
                    $id
                )
            );
        }

        $client = $this->getClientBySpaceId($idList[0]);

        if ($client === null) {
            throw new NotFoundException(
                sprintf(
                    'Item ID %s not valid.',
                    $idList[0]
                )
            );
        }

        $contentfulEntry = $this->findContentfulEntry($id);

        if ($contentfulEntry instanceof ContentfulEntry) {
            $contentfulEntry->reviveRemoteEntry($client);
        } else {
            $contentfulEntry = $this->buildContentfulEntry(
                $client->getEntry($idList[1]),
                $id
            );
        }

        if ($contentfulEntry->getIsDeleted()) {
            throw new NotFoundException(
                sprintf(
                    'Entry with ID %s deleted.',
                    $id
                )
            );
        }

        return $contentfulEntry;
    }
public function loadContentfulEntry ( string $ id ) : ContentfulEntry { $ idList = explode ( '|' , $ id ) ; if ( count ( $ idList ) !== 2 ) { throw new NotFoundException ( sprintf ( 'Item ID %s not valid.' , $ id ) ) ; } $ client = $ this -> getClientBySpaceId ( $ idList [ 0 ] ) ; if ( $ client === null ) { throw new NotFoundException ( sprintf ( 'Item ID %s not valid.' , $ idList [ 0 ] ) ) ; } $ contentfulEntry = $ this -> findContentfulEntry ( $ id ) ; if ( $ contentfulEntry instanceof ContentfulEntry ) { $ contentfulEntry -> reviveRemoteEntry ( $ client ) ; } else { $ contentfulEntry = $ this -> buildContentfulEntry ( $ client -> getEntry ( $ idList [ 1 ] ) , $ id ) ; } if ( $ contentfulEntry -> getIsDeleted ( ) ) { throw new NotFoundException ( sprintf ( 'Entry with ID %s deleted.' , $ id ) ) ; } return $ contentfulEntry ; }
Returns the Contentful entry with provided ID.

@throws \Netgen\Layouts\Contentful\Exception\NotFoundException If entry could not be loaded
Returns the Contentful entry with provided ID .