Example #1
0
 /**
  * Vrne array sprememb polj posamezne entitete
  *
  * @param Entity $entity
  * @return array
  */
 protected function getEntityChanges($entity)
 {
     $result = [];
     $changes = $this->uow->getEntityChangeSet($entity);
     foreach ($changes as $field => $change) {
         list($old, $new) = $change;
         if ($this->isEntity($old)) {
             $old = $old ? $old->getId() : $old;
         }
         if ($this->isEntity($new)) {
             $new = $new ? $new->getId() : $new;
         }
         if ($old != $new) {
             $result[$field] = [$old, $new];
         }
     }
     return $result;
 }