Pre update handler.

@param LifecycleEventArgs $args
187109
public function preUpdate(LifecycleEventArgs $args)
    {
        if ($args->getObject() instanceof MediaInterface) {
            $this->getProvider($args)->preUpdate($args->getObject());
        }
    }
278536
public function beforeUpdate(array &$args) {
        $data = &$args[1];
        $data[$this->_fields['modifiedField']] = date(self::DATE_FORMAT);
    }
1034947
public function afterUpdate(&$args) {
        $model      = $args[0];
        $where      = $args[3];

        $primaryKey = $model->extractPrimaryKey($where);
        $id         = $primaryKey['id'];

        $this->afterSave($model, $id);
    }
328945
public function handle($event, $args) {
		if (isset($this->callback[$event])) {
			$this->callback[$event](...$args);
		}
	}
1102930
public function preFlush(PreFlushEventArgs $args)
    {
        /** @var object $entity */
        foreach ($args->getEntityManager()->getUnitOfWork()->getScheduledEntityInsertions() as $entity) {
            if (false === in_array(EditableEntityTrait::class, class_uses($entity))) {
                continue;
            }

            if (null === $entity->isDeleted()) {
                $entity->setDeleted(false);
            }

            if (null === $entity->getCreated()) {
                $entity->setCreated(new DateTime());
            }

            if (null === $entity->getUpdated()) {
                $entity->setUpdated(new DateTime());
            }
        }

    }
786841
public function postPersist(LifecycleEventArgs $args)
    {
        $entity = $args->getObject();

        /** @var EntityManager $em */
        $em = $args->getObjectManager();

        if ($entity instanceof PageInterface) {
            if ($contentRoute = $entity->getContentRoute()) {
                $contentRoute->setObjectId($entity->getId());
                $contentRoute->setPath(PageHelper::getPageRoutePath($entity->getPath()));

                $em->persist($contentRoute);
                $em->getUnitOfWork()->computeChangeSet($em->getClassMetadata(get_class($contentRoute)), $contentRoute);
            }
        }
    }
1312424
public function postLoad(LifecycleEventArgs $args) {
        $entity = $args->getEntity();
        if (!$this->hasInDecodedRegistry($entity, $args->getEntityManager())) {
            if ($this->processFields($entity, false)) {
                $this->addToDecodedRegistry($entity, $args->getEntityManager());
            }
        }
    }
1237954
public function postLoad(LifecycleEventArgs $args)
    {
        if ($args->getObject() instanceof BlockInterface && !$args->getObject() instanceof DocumentBlock) {
            $this->getService($args)->postLoad($args->getObject());
        }
    }
23348
public function postLoad(LifecycleEventArgs $eventArgs)
    {
        $entityManager = $eventArgs->getEntityManager();
        $object = $eventArgs->getEntity();
        $uploadableMeta = $this->getObjectExtendedMetadata($entityManager, $object);

        if ($uploadableMeta->hasUploadableProperties()) {
            $this->loadFiles($entityManager, $object, $uploadableMeta);
        }
    }
1050306
public function postPersist(LifecycleEventArgs $args): void
    {
        // Get the object and make sure it is what we need.
        $object = $args->getObject();
        if (!$object instanceof PublishableInterface) {
            return;
        }

        // Execute published event after the object is persisted.
        if ($object->isPublished()) {
            $event = new EntityPublishedEvent($object);
            $this->event_dispatcher->dispatch(EntityPublishedEvent::NAME, $event);
        }
    }
78587
public function prePersist(LifecycleEventArgs $args)
    {
        if ($args->getObject() instanceof MediaInterface) {
            $this->getProvider($args)->prePersist($args->getObject());
        }
    }
256402
public function prePersist(LifecycleEventArgs $args) : void
    {
        $entity = $args->getEntity();

        if ($entity instanceof CreatedInterface) {
            $entity->setCreatedAt(new \DateTime());
        }
    }
120367
public function postPersist(LifecycleEventArgs $args)
    {
        $object = $args->getObject();
        if ($object instanceof UploadObjectInterface) {
            $this->storeFileUploads($object);
        }
    }
627888
public function postLoad(LifecycleEventArgs $args)
    {
        $entity = $args->getEntity();
        $this->translator->translate($entity, $this->localeResolver->getLocale());
    }
935447
public function onFlush(EventArgs $args)
    {
        $ea = $this->getEventAdapter($args);
        $om = $ea->getObjectManager();
        $uow = $om->getUnitOfWork();
        // check all scheduled updates
        $all = array_merge($ea->getScheduledObjectInsertions($uow), $ea->getScheduledObjectUpdates($uow));
        foreach ($all as $object) {
            $meta = $om->getClassMetadata(get_class($object));
            if (!$config = $this->getConfiguration($om, $meta->name)) {
                continue;
            }
            $changeSet = $ea->getObjectChangeSet($uow, $object);
            $needChanges = false;

            if ($uow->isScheduledForInsert($object) && isset($config['create'])) {
                foreach ($config['create'] as $field) {
                    list(, $new) = $changeSet[$field];
                    if ($new === null) { // let manual values
                        $needChanges = true;
                        $this->updateField($object, $ea, $meta, $field);
                    }
                }
            }

            if (isset($config['update'])) {
                foreach ($config['update'] as $field) {
                    $isInsertAndNull = $uow->isScheduledForInsert($object) && $changeSet[$field][1] === null;
                    if (!isset($changeSet[$field]) || $isInsertAndNull) { // let manual values
                        $needChanges = true;
                        $this->updateField($object, $ea, $meta, $field);
                    }
                }
            }

            if (!$uow->isScheduledForInsert($object) && isset($config['change'])) {
                foreach ($config['change'] as $options) {
                    if (isset($changeSet[$options['field']])) {
                        continue; // value was set manually
                    }

                    if (!is_array($options['trackedField'])) {
                        $singleField = true;
                        $trackedFields = array($options['trackedField']);
                    } else {
                        $singleField = false;
                        $trackedFields = $options['trackedField'];
                    }

                    foreach ($trackedFields as $tracked) {
                        $trackedChild = null;
                        $parts = explode('.', $tracked);
                        if (isset($parts[1])) {
                            if (isset($changeSet[$tracked])) {
                                $changes = $changeSet[$tracked];
                                if ($changes[0] != $changes[1]) {
                                    $needChanges = true;
                                    $this->updateField($object, $ea, $meta, $options['field']);
                                    continue;
                                }
                            }

                            $tracked = $parts[0];
                            $trackedChild = $parts[1];
                        }

                        if (isset($changeSet[$tracked])) {
                            $changes = $changeSet[$tracked];
                            if (isset($trackedChild)) {
                                $changingObject = $changes[1];
                                if (!is_object($changingObject)) {
                                    throw new UnexpectedValueException(
                                        "Field - [{$field}] is expected to be object in class - {$meta->name}"
                                    );
                                }
                                $objectMeta = $om->getClassMetadata(get_class($changingObject));
                                $om->initializeObject($changingObject);
                                $value = $objectMeta->getReflectionProperty($trackedChild)->getValue($changingObject);
                            } else {
                                $value = $changes[1];
                            }

                            if (($singleField && in_array($value, (array) $options['value'])) || $options['value'] === null) {
                                $needChanges = true;
                                $this->updateField($object, $ea, $meta, $options['field']);
                            }
                        }
                    }
                }
            }

            if ($needChanges) {
                $ea->recomputeSingleObjectChangeSet($uow, $meta, $object);
            }
        }
    }
226514
public function postPersist(LifecycleEventArgs $args)
    {
        $object = $args->getEntity();

        if (($names = $this->referenceRepository->getReferenceNames($object)) !== false) {
            foreach ($names as $name) {
                $identity = $args->getEntityManager()
                    ->getUnitOfWork()
                    ->getEntityIdentifier($object);

                $this->referenceRepository->setReferenceIdentity($name, $identity);
            }
        }
    }
911323
public function prePersist(LifecycleEventArgs $args): void
    {
        // Only act on invitation objects.
        $invitation = $args->getObject();
        if (!$invitation instanceof Invitation) {
            return;
        }

        // If the event author is the invitee accept the invitation.
        $event = $invitation->getEvent();
        if ($event->getAuthor() == $invitation->getInvitee()) {
            $invitation->setResponse(Invitation::RESPONSE_ACCEPT);
        }
    }