src/Sulu/Bundle/PageBundle/Search/EventSubscriber/BlameTimestampSubscriber.php
private function mapCreatorAndChanger(Document $document, UserInterface $creator = null, UserInterface $changer = null)
    {
        $document->addField(
            $this->factory->createField('changer', $changer ? $changer->getUsername() : null, 'string')
        );
        $document->addField(
            $this->factory->createField('changer_id', $changer ? $changer->getId() : null, 'string')
        );

        $document->addField(
            $this->factory->createField('creator', $creator ? $creator->getUsername() : null, 'string')
        );
        $document->addField(
            $this->factory->createField('creator_id', $creator ? $creator->getId() : null, 'string')
        );
    }
private function mapCreatorAndChanger(Document $document, UserInterface $creator = null, UserInterface $changer = null)
    {
        $document->addField(
            $this->factory->createField('changer', $changer ? $changer->getUsername() : null, 'string')
        );
        $document->addField(
            $this->factory->createField('changer_id', $changer ? $changer->getId() : null, 'string')
        );

        $document->addField(
            $this->factory->createField('creator', $creator ? $creator->getUsername() : null, 'string')
        );
        $document->addField(
            $this->factory->createField('creator_id', $creator ? $creator->getId() : null, 'string')
        );
    }
private function mapCreatorAndChanger ( Document $ document , UserInterface $ creator = null , UserInterface $ changer = null ) { $ document -> addField ( $ this -> factory -> createField ( 'changer' , $ changer ? $ changer -> getUsername ( ) : null , 'string' ) ) ; $ document -> addField ( $ this -> factory -> createField ( 'changer_id' , $ changer ? $ changer -> getId ( ) : null , 'string' ) ) ; $ document -> addField ( $ this -> factory -> createField ( 'creator' , $ creator ? $ creator -> getUsername ( ) : null , 'string' ) ) ; $ document -> addField ( $ this -> factory -> createField ( 'creator_id' , $ creator ? $ creator -> getId ( ) : null , 'string' ) ) ; }
Map the creator and changer to the document.

@param Document $document
@param UserInterface $creator
@param UserInterface $changer
Map the creator and changer to the document .