public function add(DocumentInterface $document)
    {
        $this->documents[(string) $document->getIdentity()] = $document;

        return $this;
    }
public function add(DocumentInterface $document)
    {
        $this->documents[(string) $document->getIdentity()] = $document;

        return $this;
    }
public function add ( DocumentInterface $ document ) { $ this -> documents [ ( string ) $ document -> getIdentity ( ) ] = $ document ; return $ this ; }
Adds a document to the result set.

@param \Phlexible\Bundle\IndexerBundle\Document\DocumentInterface $document

@return $this
Adds a document to the result set .