public function preUpdate(PreUpdateEventArgs $args) { echo 'sup;'; exit; $entity = $args->getObject(); if ($entity instanceof TrackModifications) { $args->setNewValue("lastModification", new \DateTime()); } }
/** * Constructor. * * @param object $document * @param DocumentManager $objectManager * @param array $changeSet */ public function __construct($document, DocumentManager $documentManager, array &$changeSet) { $fieldChangeSet = array(); if (isset($changeSet['fields'])) { $fieldChangeSet =& $changeSet['fields']; } parent::__construct($document, $documentManager, $fieldChangeSet); $this->documentChangeSet =& $changeSet; }