Doctrine\ODM\MongoDB\UnitOfWork::unscheduleOrphanRemoval PHP Method

unscheduleOrphanRemoval() public method

INTERNAL: Unschedules an embedded or referenced object for removal.
public unscheduleOrphanRemoval ( object $document )
$document object
    public function unscheduleOrphanRemoval($document)
    {
        $oid = spl_object_hash($document);
        if (isset($this->orphanRemovals[$oid])) {
            unset($this->orphanRemovals[$oid]);
        }
    }

Usage Example

 /**
  * Actual logic for setting an element in the collection.
  *
  * @param mixed $offset
  * @param mixed $value
  * @param bool $arrayAccess
  * @return bool
  */
 private function doSet($offset, $value, $arrayAccess)
 {
     $arrayAccess ? $this->coll->offsetSet($offset, $value) : $this->coll->set($offset, $value);
     // Handle orphanRemoval
     if ($this->uow !== null && $this->isOrphanRemovalEnabled() && $value !== null) {
         $this->uow->unscheduleOrphanRemoval($value);
     }
     $this->changed();
 }
All Usage Examples Of Doctrine\ODM\MongoDB\UnitOfWork::unscheduleOrphanRemoval
UnitOfWork