src/Sulu/Component/Content/Document/Subscriber/TitleSubscriber.php
public function setTitleOnNode(AbstractMappingEvent $event)
    {
        $document = $event->getDocument();

        if (!$this->supports($document)) {
            return;
        }

        if ($document instanceof LocalizedTitleBehavior) {
            if (!$event->getLocale()) {
                return;
            }

            $event->getNode()->setProperty(
                $this->propertyEncoder->localizedContentName(static::PROPERTY_NAME, $event->getLocale()),
                $document->getTitle()
            );
        } else {
            $event->getNode()->setProperty(
                $this->propertyEncoder->contentName(static::PROPERTY_NAME),
                $document->getTitle()
            );
        }
    }
public function setTitleOnNode(AbstractMappingEvent $event)
    {
        $document = $event->getDocument();

        if (!$this->supports($document)) {
            return;
        }

        if ($document instanceof LocalizedTitleBehavior) {
            if (!$event->getLocale()) {
                return;
            }

            $event->getNode()->setProperty(
                $this->propertyEncoder->localizedContentName(static::PROPERTY_NAME, $event->getLocale()),
                $document->getTitle()
            );
        } else {
            $event->getNode()->setProperty(
                $this->propertyEncoder->contentName(static::PROPERTY_NAME),
                $document->getTitle()
            );
        }
    }
public function setTitleOnNode ( AbstractMappingEvent $ event ) { $ document = $ event -> getDocument ( ) ; if ( ! $ this -> supports ( $ document ) ) { return ; } if ( $ document instanceof LocalizedTitleBehavior ) { if ( ! $ event -> getLocale ( ) ) { return ; } $ event -> getNode ( ) -> setProperty ( $ this -> propertyEncoder -> localizedContentName ( static :: PROPERTY_NAME , $ event -> getLocale ( ) ) , $ document -> getTitle ( ) ) ; } else { $ event -> getNode ( ) -> setProperty ( $ this -> propertyEncoder -> contentName ( static :: PROPERTY_NAME ) , $ document -> getTitle ( ) ) ; } }
Sets the title on the node from the value in the document.

@param PersistEvent $event
Sets the title on the node from the value in the document .