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()),
                        ]);
                    }
                }
            }
        }
    }