/** * Iterate over deleted entities and process them * * @return void * @author Karsten Dambekalns <*****@*****.**> */ protected function processDeletedObjects() { foreach ($this->deletedEntities as $entity) { if ($this->persistenceSession->hasObject($entity)) { $this->removeEntity($entity); $this->persistenceSession->unregisterObject($entity); } } $this->deletedEntities = new \SplObjectStorage(); }
/** * Returns the (internal) identifier for the object, if it is known to the * backend. Otherwise NULL is returned. * * Note: this returns an identifier even if the object has not been * persisted in case of AOP-managed entities. Use isNewObject() if you need * to distinguish those cases. * * @param object $object * @return string The identifier for the object * @author Karsten Dambekalns <*****@*****.**> * @api */ public function getIdentifierByObject($object) { if ($this->persistenceSession->hasObject($object)) { return $this->persistenceSession->getIdentifierByObject($object); } elseif ($object instanceof \F3\FLOW3\AOP\ProxyInterface && $object->FLOW3_AOP_Proxy_hasProperty('FLOW3_Persistence_Entity_UUID')) { // entities created get an UUID set through AOP return $object->FLOW3_AOP_Proxy_getProperty('FLOW3_Persistence_Entity_UUID'); } elseif ($object instanceof \F3\FLOW3\AOP\ProxyInterface && $object->FLOW3_AOP_Proxy_hasProperty('FLOW3_Persistence_ValueObject_Hash')) { // valueobjects created get a hash set through AOP return $object->FLOW3_AOP_Proxy_getProperty('FLOW3_Persistence_ValueObject_Hash'); } else { return NULL; } }