/**
  * Determines whether an document instance is managed in this DocumentManager.
  *
  * @param object $document
  * @return boolean TRUE if this DocumentManager currently manages the given document, FALSE otherwise.
  */
 public function contains($document)
 {
     return $this->_unitOfWork->isScheduledForInsert($document) || $this->_unitOfWork->isInIdentityMap($document) && !$this->_unitOfWork->isScheduledForDelete($document);
 }