If entity is a View
it will find the ViewReference related to the current view and populate its url.

@param LifecycleEventArgs $eventArgs
436296
public function postLoad(LifecycleEventArgs $eventArgs)
    {
        $entity = $eventArgs->getEntity();

        if ($entity instanceof View) {
            $entity->setReferences([$entity->getCurrentLocale() => new ViewReference($entity->getId())]);
            $viewReferences = $this->viewReferenceRepository->getReferencesByParameters([
                'viewId'     => $entity->getId(),
                'templateId' => $entity->getId(),
            ], true, false, 'OR');
            foreach ($viewReferences as $viewReference) {
                if ($viewReference->getLocale() === $entity->getCurrentLocale()) {
                    if ($entity instanceof WebViewInterface && $viewReference instanceof ViewReference) {
                        $entity->setReference($viewReference, $viewReference->getLocale());
                        $entity->setUrl($viewReference->getUrl());
                    } elseif ($entity instanceof BusinessTemplate) {
                        $entity->setReferences([
                            $entity->getCurrentLocale() => $this->viewReferenceBuilder->buildViewReference($entity, $eventArgs->getEntityManager()),
                        ]);
                    }
                }
            }
        }
    }
1284218
public function onClear($eventArgs)
    {
        parent::onClear($eventArgs);

        $aliases             = array_keys($this->identifierMap);
        $this->identifierMap = array();

        foreach ($aliases as $alias) {
            $this->identifierMap[$alias] = array();
        }
    }
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);
            }
        }
    }
502954
public function prePersist(LifecycleEventArgs $eventArgs)
    {
        $em = $eventArgs->getEntityManager();
        $uow = $em->getUnitOfWork();
        $entity = $eventArgs->getEntity();

        $classMetadata = $em->getClassMetadata(get_class($entity));
        if ($this->isBlameable($classMetadata)) {
            if (!$entity->getCreatedBy()) {
                $user = $this->getUser();
                if ($this->isValidUser($user)) {
                    $entity->setCreatedBy($user);

                    $uow->propertyChanged($entity, 'createdBy', null, $user);
                    $uow->scheduleExtraUpdate($entity, [
                        'createdBy' => [null,  $user],
                    ]);
                }
            }
            if (!$entity->getUpdatedBy()) {
                $user = $this->getUser();
                if ($this->isValidUser($user)) {
                    $entity->setUpdatedBy($user);
                    $uow->propertyChanged($entity, 'updatedBy', null, $user);

                    $uow->scheduleExtraUpdate($entity, [
                        'updatedBy' => [null, $user],
                    ]);
                }
            }
        }
    }
731113
public function postLoad(LifecycleEventArgs $args): void
    {
        $token = $this->getTokenStorage()->getToken();

        if (!$this->getPermissionManager()->isEnabled()
                || null === $token || $token instanceof ConsoleToken) {
            return;
        }

        $object = $args->getEntity();
        $this->getObjectFilter()->filter($object);
    }
170550
protected function getUpdateByNameFromUser(LifecycleEventArgs $eventArgs)
    {
        if (!$this->hasCurrentUser()) {
            return $this->getFallbackUser();
        }

        if (null !== $name = $this->getNameFromUser($this->currentUser())) {
            return $name;
        }

        $identifier = 'id';
        $user       = $this->currentUser();
        $repo       = $eventArgs->getEntityManager()->getRepository($this->getUserClass());

        // did not implement standard methods, try and look them up using identifier
        if ($user instanceof AuthenticatableContract) {
            $identifier = $user->getAuthIdentifierName();
        }

        if (null !== $user = $repo->findOneBy([$identifier => $user->getAuthIdentifier()])) {
            if (null !== $name = $this->getNameFromUser($user)) {
                return $name;
            }
        }

        // fall back completely
        return $this->getFallbackUser();
    }
1261075
public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs)
    {
        $classMetadata = $eventArgs->getClassMetadata();
        $reflClass = $classMetadata->reflClass;

        if (!$reflClass) {
            return;
        }

        if ($reflClass->implementsInterface('Prezent\Doctrine\Translatable\TranslatableInterface')) {
            $this->mapTranslatable($classMetadata);
        }

        if ($reflClass->implementsInterface('Prezent\Doctrine\Translatable\TranslationInterface')) {
            $this->mapTranslation($classMetadata);
        }
    }
120367
public function postPersist(LifecycleEventArgs $args)
    {
        $object = $args->getObject();
        if ($object instanceof UploadObjectInterface) {
            $this->storeFileUploads($object);
        }
    }
1358211
public function postPersist(LifecycleEventArgs $args)
    {
        if ($args->getObject() instanceof MediaInterface) {
            $this->getProvider($args)->postPersist($args->getObject());
        }
    }
821062
public function postPersist(LifecycleEventArgs $args)
    {
        if ($args->getObject() instanceof BlockInterface && !$args->getObject() instanceof DocumentBlock) {
            $this->getService($args)->postPersist($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);
        }
    }
393895
public function onClear($eventArgs)
    {
        parent::onClear($eventArgs);

        $aliases = array_keys($this->identifierMap);

        $this->identifierMap = array_fill_keys($aliases, []);
    }
309382
public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs)
    {
        $classMetadata = $eventArgs->getClassMetadata();
        $entityName = (string) $classMetadata->getName();

        // We dynamically set the user class that was configured in the configuration
        if ($entityName == 'Kunstmaan\AdminBundle\Entity\AclChangeset') {
            $mapping = array(
                'fieldName' => 'user',
                'targetEntity' => $this->className,
                'joinColumns' => array(array(
                    'name' => 'user_id',
                    'referencedColumnName' => 'id',
                    'unique' => false,
                    'nullable' => true,
                )),
            );
            $classMetadata->mapManyToOne($mapping);
        }

        // If we overwrite the user entity, we should create a new join table with the groups
        if ($entityName == $this->className) {
            $tableName = $classMetadata->table['name'];
            $mapping = array(
                'fieldName' => 'groups',
                'joinTable' => array(
                    'name' => $tableName . '_groups',
                    'joinColumns' => array(array(
                        'name' => 'user_id',
                        'unique' => false,
                        'nullable' => true,
                        'referencedColumnName' => 'id',
                    )),
                    'inverseJoinColumns' => array(array(
                        'name' => 'group_id',
                        'unique' => false,
                        'nullable' => true,
                        'referencedColumnName' => 'id',
                    )),
                ),
                'targetEntity' => 'Kunstmaan\AdminBundle\Entity\Group',
                'sourceEntity' => $this->className,
            );
            $classMetadata->mapManyToMany($mapping);
        }
    }
256402
public function prePersist(LifecycleEventArgs $args) : void
    {
        $entity = $args->getEntity();

        if ($entity instanceof CreatedInterface) {
            $entity->setCreatedAt(new \DateTime());
        }
    }
1139005
public function prePersist(LifecycleEventArgs $args)
    {

        // update child routes
        $entity = $args->getEntity();

        if (    $entity instanceof RoutableNodeInterface
            &&  $entity->hasAutoNodeRouteGeneration()
        ) {
            $routeManager = $this->container->get('mm_cmf_routing.node_route_manager');
            $entity->addRoute($routeManager->generateAutoNodeRoute($entity));
        }

        return;
    }
826928
private function updateViewReference(LifecycleEventArgs $eventArgs)
    {
        $entity = $eventArgs->getEntity();

        //if entity is a translation, get its translatable entity
        if (in_array(Translation::class, class_uses($entity)) && null !== $entity->getTranslatable()) {
            $entity = $entity->getTranslatable();
        }

        //if it's a businessEntity we need to rebuild virtuals (BPs are rebuild in businessEntitySubscriber)
        if ($businessEntity = $this->businessEntityHelper->findByEntityInstance($entity)) {
            $this->flushedBusinessEntities->add($entity);
        }
        //if it a businessTemplate we have to rebuild virtuals or update BP
        if ($entity instanceof BusinessTemplate) {
            $this->flushedBusinessTemplates->add($entity);
        }
    }
235075
public function postLoad(LifecycleEventArgs $args)
    {
        $this
            ->container
            ->get('elcodi.entity_translator')
            ->translate(
                $args->getEntity(),
                $this->locale->getIso()
            );
    }