public function remove($document)
    {
        $data = $this->converter->convertToArray($document, [], ['_id', '_routing']);

        if (!isset($data['_id'])) {
            throw new \LogicException(
                'In order to use remove() method document class must have property with @Id annotation.'
            );
        }

        $type = $this->getMetadataCollector()->getDocumentType(get_class($document));

        $this->bulk('delete', $type, $data);
    }
public function remove($document)
    {
        $data = $this->converter->convertToArray($document, [], ['_id', '_routing']);

        if (!isset($data['_id'])) {
            throw new \LogicException(
                'In order to use remove() method document class must have property with @Id annotation.'
            );
        }

        $type = $this->getMetadataCollector()->getDocumentType(get_class($document));

        $this->bulk('delete', $type, $data);
    }
public function remove ( $ document ) { $ data = $ this -> converter -> convertToArray ( $ document , [ ] , [ '_id' , '_routing' ] ) ; if ( ! isset ( $ data [ '_id' ] ) ) { throw new \ LogicException ( 'In order to use remove() method document class must have property with @Id annotation.' ) ; } $ type = $ this -> getMetadataCollector ( ) -> getDocumentType ( get_class ( $ document ) ) ; $ this -> bulk ( 'delete' , $ type , $ data ) ; }
Adds document for removal.

@param object $document
Adds document for removal .