Doctrine\ODM\MongoDB\Query\Builder::findAndRemove PHP Method

findAndRemove() public method

public findAndRemove ( $documentName = null )
    public function findAndRemove($documentName = null)
    {
        $this->setDocumentName($documentName);
        return parent::findAndRemove();
    }

Usage Example

 /**
  * Sets a flag for the query to be executed as a findAndUpdate query.
  * Optionally sets the document name for the query
  *
  * @param string $documentName
  * @return QueryProxy this instance
  */
 public function findAndRemove($documentName = null)
 {
     $this->queryChanged = true;
     return parent::findAndRemove();
 }