Find page-title property.

@param ArticleInterface $document

@return PropertyMetadata
776412
private function getPageTitleProperty(ArticleInterface $document)
    {
        $metadata = $this->structureMetadataFactory->getStructureMetadata(
            'article',
            $document->getStructureType()
        );

        if ($metadata->hasPropertyWithTagName(self::PAGE_TITLE_TAG_NAME)) {
            return $metadata->getPropertyByTagName(self::PAGE_TITLE_TAG_NAME);
        }

        if ($metadata->hasProperty(self::PAGE_TITLE_PROPERTY_NAME)) {
            return $metadata->getProperty(self::PAGE_TITLE_PROPERTY_NAME);
        }

        return null;
    }
502788
public static function getDebugTitle($document)
    {
        $title = spl_object_hash($document);

        if ($document instanceof PathBehavior && $document->getPath()) {
            $title .= ' (' . $document->getPath() . ')';
        } elseif ($document instanceof TitleBehavior && $document->getTitle()) {
            $title .= ' (' . $document->getTitle() . ')';
        }

        return $title;
    }
440820
public function build(DocumentInterface $document)
    {
        /**@var $document Invoice */
        $template = 'invoice'.$document->getUblVersion().'.xml.twig';

        return $this->render($template, $document);
    }
1227861
private function toDocument(MetaInformationInterface $metaInformation): DocumentInterface
    {
        $doc = $this->entityMapper->toDocument($metaInformation);

        return $doc;
    }
1125710
private function getSnippets(PropertyInterface $property)
    {
        /** @var PageBridge $page */
        $page = $property->getStructure();
        $webspaceKey = $page->getWebspaceKey();
        $locale = $page->getLanguageCode();
        $shadowLocale = null;
        if ($page->getIsShadow()) {
            $shadowLocale = $page->getShadowBaseLanguage();
        }

        $refs = $property->getValue();
        $ids = $this->getUuids($refs);

        $snippetType = $this->getParameterValue($property->getParams(), 'snippetType');
        $default = $this->getParameterValue($property->getParams(), 'default', false);

        $snippetArea = $default;
        if (true === $snippetArea || 'true' === $snippetArea) {
            $snippetArea = $snippetType;
        }

        if (empty($ids) && $snippetArea && $this->defaultEnabled) {
            $ids = $this->loadSnippetAreaIds($webspaceKey, $snippetArea, $locale);
        }

        return $this->snippetResolver->resolve($ids, $webspaceKey, $locale, $shadowLocale);
    }
1030222
public function getTitleFor(AbstractPage $entity)
    {
        $arr = array();

        $arr[] = $this->getSeoTitle($entity);

        $arr[] = $entity->getTitle();

        return $this->getPreferredValue($arr);
    }
118176
private function findRelatedPage($entity)
    {
        // By Translation
        if ($entity instanceof Cms\PageTranslationInterface) {
            return $entity->getTranslatable();
        }

        // By Seo
        if ($entity instanceof Cms\SeoTranslationInterface && null !== $entity->getId()) {
            return $this->manager
                ->createQuery("SELECT p FROM {$this->pageClass} p WHERE p.seo = :seo")
                ->setMaxResults(1)
                ->setParameter('seo', $entity->getTranslatable())
                ->getOneOrNullResult();
        }

        // By Content
        /** @var \Ekyna\Bundle\CmsBundle\Editor\Model\ContentInterface $content */
        $content = null;
//       TODO if ($entity instanceof Cms\BlockTranslationInterface) {
//            /** @var Cms\BlockInterface $block */
//            $block = $entity->getTranslatable();
//            $content = $block->getContent();
//        }
        if (null !== $content && null !== $content->getId()) {
            return $this->manager
                ->createQuery("SELECT p FROM {$this->pageClass} p WHERE p.content = :content")
                ->setMaxResults(1)
                ->setParameter('content', $content)
                ->getOneOrNullResult();
        }

        return null;
    }
326847
public function getXmlSigned(DocumentInterface $document)
    {
        $classDoc = get_class($document);

        return $this->factory
            ->setBuilder($this->getBuilder($classDoc))
            ->getXmlSigned($document);
    }
530243
private function getTargetWebspace(ArticleViewDocumentInterface $document)
    {
        if (!$this->requestAnalyzer->getWebspace()) {
            return null;
        }

        $webspaceKey = $this->requestAnalyzer->getWebspace()->getKey();

        if ($document->getMainWebspace() === $webspaceKey
            || ($document->getAdditionalWebspaces() && in_array($webspaceKey, $document->getAdditionalWebspaces()))
        ) {
            return $webspaceKey;
        }

        return $document->getMainWebspace();
    }
304991
private function getArticleType(ArticleDocument $articleDocument)
    {
        $structureMetadata = $this->structureMetadataFactory->getStructureMetadata(
            'article',
            $articleDocument->getStructureType()
        );

        return $this->getType($structureMetadata);
    }
888000
protected function serializeArticle(ArticleInterface $object, $pageNumber)
    {
        return $this->get('jms_serializer')->serialize(
            $object,
            'array',
            SerializationContext::create()
                ->setSerializeNull(true)
                ->setGroups(['website', 'content'])
                ->setAttribute('website', true)
                ->setAttribute('pageNumber', $pageNumber)
        );
    }
1249033
private function findWritingLockMeta(ArticleInterface $article)
    {
        $metaLock = null;

        //search writing_lock data
        foreach($article->getMetaData() as $meta)
        {
            if($meta->getKey() == 'writing_locked')
            {
                $metaLock = $meta;

                break;
            }
        }

        return $metaLock;
    }
731740
public function getTitle( $throwException = TRUE )
	{
		$nodes	= $this->document->getElementsByTagName( "title" );
		if( $nodes->length )
			return $nodes->item(0)->textContent;
		$tags	= $this->getMetaTags( TRUE );
		if( isset( $tags['dc.title'] ) )
			return $tags['dc.title'];
		if( $throwException )
			throw new RuntimeException( 'Neither Title Tag not Title Meta Tag found.' );
		return "";
	}
1208982
public function setProperty(PropertyInterface $property)
    {
        $this->property      = $property;
        $this->propertyType  = $property->type();
        $this->propertyIdent = $property->ident();

        $inputType = $property['input_type'];
        if ($inputType) {
            $this->inputType = $inputType;
        }

        $displayType = $property['display_type'];
        if ($displayType) {
            $this->displayType = $displayType;
        }

        return $this;
    }
447701
public function getContentTypePageUrl(ContentTypePage $page, ContentInterface $document)
    {
        return $this->router->generate(
            $this->getRouteName($page),
            $this->getRoutingParamaters($page, $document)
        );
    }
1146454
private function readPage($propertyName, NodeInterface $node)
    {
        $pagePropertyName = $propertyName . '-page';
        if (!$node->hasProperty($pagePropertyName)) {
            return;
        }

        try {
            $pageUuid = $node->getPropertyValue($pagePropertyName, PropertyType::STRING);
        } catch (ItemNotFoundException $exception) {
            return;
        }

        return [
            'uuid' => $pageUuid,
            'path' => $node->getPropertyValueWithDefault($pagePropertyName . '-path', ''),
            'webspace' => $node->getPropertyValueWithDefault($pagePropertyName . '-webspace', null),
        ];
    }
989126
public static function createFromProperty(PropertyInterface $property)
    {
        $tag = new self();
        $tag->setName(self::TAG_VAR);
        $tag->setType($property->getType());

        return $tag;
    }