PageTree/PageTreeRepository.php
private function updateArticle(ArticleDocument $article, BasePageDocument $document)
    {
        $locale = $document->getLocale();
        $resourceSegment = $document->getResourceSegment();

        $property = $this->getRoutePathPropertyNameByStructureType($article->getStructureType());
        $propertyName = $this->propertyEncoder->localizedContentName($property->getName(), $locale);

        $node = $this->documentInspector->getNode($article);
        $node->setProperty($propertyName . '-page', $document->getUuid());
        $node->setProperty($propertyName . '-page-path', $resourceSegment);

        $suffix = $node->getPropertyValueWithDefault($propertyName . '-suffix', null);
        if ($suffix) {
            $path = rtrim($resourceSegment, '/') . '/' . $suffix;
            $node->setProperty($propertyName, $path);
            $article->setRoutePath($path);
        }

        $workflowStage = $article->getWorkflowStage();

        $this->documentManager->persist($article, $locale);
        if (WorkflowStage::PUBLISHED === $workflowStage) {
            $this->documentManager->publish($article, $locale);
        }
    }
private function updateArticle(ArticleDocument $article, BasePageDocument $document)
    {
        $locale = $document->getLocale();
        $resourceSegment = $document->getResourceSegment();

        $property = $this->getRoutePathPropertyNameByStructureType($article->getStructureType());
        $propertyName = $this->propertyEncoder->localizedContentName($property->getName(), $locale);

        $node = $this->documentInspector->getNode($article);
        $node->setProperty($propertyName . '-page', $document->getUuid());
        $node->setProperty($propertyName . '-page-path', $resourceSegment);

        $suffix = $node->getPropertyValueWithDefault($propertyName . '-suffix', null);
        if ($suffix) {
            $path = rtrim($resourceSegment, '/') . '/' . $suffix;
            $node->setProperty($propertyName, $path);
            $article->setRoutePath($path);
        }

        $workflowStage = $article->getWorkflowStage();

        $this->documentManager->persist($article, $locale);
        if (WorkflowStage::PUBLISHED === $workflowStage) {
            $this->documentManager->publish($article, $locale);
        }
    }
private function updateArticle ( ArticleDocument $ article , BasePageDocument $ document ) { $ locale = $ document -> getLocale ( ) ; $ resourceSegment = $ document -> getResourceSegment ( ) ; $ property = $ this -> getRoutePathPropertyNameByStructureType ( $ article -> getStructureType ( ) ) ; $ propertyName = $ this -> propertyEncoder -> localizedContentName ( $ property -> getName ( ) , $ locale ) ; $ node = $ this -> documentInspector -> getNode ( $ article ) ; $ node -> setProperty ( $ propertyName . '-page' , $ document -> getUuid ( ) ) ; $ node -> setProperty ( $ propertyName . '-page-path' , $ resourceSegment ) ; $ suffix = $ node -> getPropertyValueWithDefault ( $ propertyName . '-suffix' , null ) ; if ( $ suffix ) { $ path = rtrim ( $ resourceSegment , '/' ) . '/' . $ suffix ; $ node -> setProperty ( $ propertyName , $ path ) ; $ article -> setRoutePath ( $ path ) ; } $ workflowStage = $ article -> getWorkflowStage ( ) ; $ this -> documentManager -> persist ( $ article , $ locale ) ; if ( WorkflowStage :: PUBLISHED === $ workflowStage ) { $ this -> documentManager -> publish ( $ article , $ locale ) ; } }
Update route of given article.

@param ArticleDocument $article
@param BasePageDocument $document
Update route of given article .