Bundle/BusinessEntityBundle/EventSubscriber/BusinessEntitySubscriber.php
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);
        }
    }
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);
        }
    }
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 ) ; } }
This method throw an event if needed for a view related to a businessEntity.

@param LifecycleEventArgs $eventArgs

@throws \Exception
This method throw an event if needed for a view related to a businessEntity .