private function buildContentfulEntry(Entry $remoteEntry, string $id): ContentfulEntry
    {
        $contentfulEntry = new ContentfulEntry($remoteEntry);
        $contentfulEntry->setIsPublished(true);
        $contentfulEntry->setJson((string) json_encode($remoteEntry));

        $route = new Route();
        $route->setName($id);
        $route->setStaticPrefix($this->entrySlugger->getSlug($contentfulEntry));
        $route->setDefault(RouteObjectInterface::CONTENT_ID, ContentfulEntry::class . ':' . $id);
        $route->setContent($contentfulEntry);
        $contentfulEntry->addRoute($route); // Create the back-link from content to route

        $this->entityManager->persist($contentfulEntry);
        $this->entityManager->persist($route);
        $this->entityManager->flush();

        return $contentfulEntry;
    }
private function buildContentfulEntry(Entry $remoteEntry, string $id): ContentfulEntry
    {
        $contentfulEntry = new ContentfulEntry($remoteEntry);
        $contentfulEntry->setIsPublished(true);
        $contentfulEntry->setJson((string) json_encode($remoteEntry));

        $route = new Route();
        $route->setName($id);
        $route->setStaticPrefix($this->entrySlugger->getSlug($contentfulEntry));
        $route->setDefault(RouteObjectInterface::CONTENT_ID, ContentfulEntry::class . ':' . $id);
        $route->setContent($contentfulEntry);
        $contentfulEntry->addRoute($route); // Create the back-link from content to route

        $this->entityManager->persist($contentfulEntry);
        $this->entityManager->persist($route);
        $this->entityManager->flush();

        return $contentfulEntry;
    }
private function buildContentfulEntry ( Entry $ remoteEntry , string $ id ) : ContentfulEntry { $ contentfulEntry = new ContentfulEntry ( $ remoteEntry ) ; $ contentfulEntry -> setIsPublished ( true ) ; $ contentfulEntry -> setJson ( ( string ) json_encode ( $ remoteEntry ) ) ; $ route = new Route ( ) ; $ route -> setName ( $ id ) ; $ route -> setStaticPrefix ( $ this -> entrySlugger -> getSlug ( $ contentfulEntry ) ) ; $ route -> setDefault ( RouteObjectInterface :: CONTENT_ID , ContentfulEntry :: class . ':' . $ id ) ; $ route -> setContent ( $ contentfulEntry ) ; $ contentfulEntry -> addRoute ( $ route ) ; // Create the back-link from content to route $ this -> entityManager -> persist ( $ contentfulEntry ) ; $ this -> entityManager -> persist ( $ route ) ; $ this -> entityManager -> flush ( ) ; return $ contentfulEntry ; }
Builds the Contentful entry from provided remote entry.
Builds the Contentful entry from provided remote entry .