detach() public method

Detaches a document from the persistence management. It's persistence will no longer be managed by Doctrine.
public detach ( object $document )
$document object The document to detach.
Example #1
0
 /**
  * Detaches a document from the DocumentManager, causing a managed document to
  * become detached.  Unflushed changes made to the document if any
  * (including removal of the document), will not be synchronized to the database.
  * Documents which previously referenced the detached document will continue to
  * reference it.
  *
  * @param object $document The document to detach.
  */
 public function detach($document)
 {
     if (!is_object($document)) {
         throw new \InvalidArgumentException(gettype($document));
     }
     $this->unitOfWork->detach($document);
 }