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

findAndUpdate() public method

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

Usage Example

Example #1
0
 /**
  * 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 findAndUpdate($documentName = null)
 {
     $this->queryChanged = true;
     return parent::findAndUpdate($documentName);
 }