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);
        }
    }