public function persist($document)
    {
        $documentArray = $this->converter->convertToArray($document);
        $type = $this->getMetadataCollector()->getDocumentType(get_class($document));

        $this->bulk('index', $type, $documentArray);
    }
public function persist($document)
    {
        $documentArray = $this->converter->convertToArray($document);
        $type = $this->getMetadataCollector()->getDocumentType(get_class($document));

        $this->bulk('index', $type, $documentArray);
    }
public function persist ( $ document ) { $ documentArray = $ this -> converter -> convertToArray ( $ document ) ; $ type = $ this -> getMetadataCollector ( ) -> getDocumentType ( get_class ( $ document ) ) ; $ this -> bulk ( 'index' , $ type , $ documentArray ) ; }
Adds document to next flush.

@param object $document
Adds document to next flush .