예제 #1
0
 /**
  * Iterate over deleted entities and process them
  *
  * @return void
  */
 protected function processDeletedObjects()
 {
     foreach ($this->deletedEntities as $entity) {
         if ($this->persistenceSession->hasObject($entity)) {
             $this->removeEntity($entity);
             $this->persistenceSession->unregisterReconstitutedEntity($entity);
             $this->persistenceSession->unregisterObject($entity);
         }
     }
     $this->deletedEntities = new \SplObjectStorage();
 }
예제 #2
0
 /**
  * Checks if the given object has ever been persisted.
  *
  * @param object $object The object to check
  * @return boolean TRUE if the object is new, FALSE if the object exists in the persistence session
  * @api
  */
 public function isNewObject($object)
 {
     return $this->persistenceSession->hasObject($object) === FALSE;
 }