public function onFlush(OnFlushEventArgs $eventArgs) { $this->em = $eventArgs->getEntityManager(); $this->conn = $this->em->getConnection(); $this->uow = $this->em->getUnitOfWork(); $this->platform = $this->conn->getDatabasePlatform(); $this->revisionId = null; // reset revision foreach ($this->uow->getScheduledEntityDeletions() as $entity) { $class = $this->em->getClassMetadata(get_class($entity)); if (!$this->metadataFactory->isAudited($class->name)) { continue; } $entityData = array_merge($this->getOriginalEntityData($entity), $this->uow->getEntityIdentifier($entity)); $this->saveRevisionEntityData($class, $entityData, 'DEL'); } }
/** * Zapiše vse spremenjene entitete in kolekcije za nadaljno obdelavo */ protected function fetchScheduledChanges() { $this->collections = array_values($this->uow->getScheduledCollectionUpdates()); $this->entities = array_merge(array_values($this->uow->getScheduledEntityInsertions()), array_values($this->uow->getScheduledEntityUpdates()), array_values($this->uow->getScheduledEntityDeletions())); }