Example #1
0
 /**
  * Updates a field
  *
  * @param object               $object
  * @param TimestampableAdapter $ea
  * @param object               $meta
  * @param string               $field
  */
 protected function updateField($object, $ea, $meta, $field)
 {
     $property = $meta->getReflectionProperty($field);
     $oldValue = $property->getValue($object);
     $newValue = $ea->getDateValue($meta, $field);
     $property->setValue($object, $newValue);
     if ($object instanceof NotifyPropertyChanged) {
         $uow = $ea->getObjectManager()->getUnitOfWork();
         $uow->propertyChanged($object, $field, $oldValue, $newValue);
     }
 }
 /**
  * @param ClassMetadata $meta
  * @param string $field
  * @param TimestampableAdapter $eventAdapter
  * @return mixed
  */
 protected function getFieldValue($meta, $field, $eventAdapter)
 {
     return $eventAdapter->getDateValue($meta, $field);
 }