Bundle/CoreBundle/EventSubscriber/EntityProxySubscriber.php
public static function loadClassMetadata($eventArgs)
    {
        if ($eventArgs instanceof LoadClassMetadataEventArgs) {
            /** @var ClassMetadata $metadatas */
            $metadatas = $eventArgs->getClassMetadata();
            if ($metadatas->name === 'Victoire\Bundle\CoreBundle\Entity\EntityProxy') {
                foreach (self::$cacheReader->getBusinessClasses() as $entity) {
                    if (!$metadatas->hasAssociation($entity->getId())) {
                        $metadatas->mapOneToOne([
                            'fieldName'    => $entity->getId(),
                            'targetEntity' => $entity->getClass(),
                            'cascade'      => ['persist'],
                            ]
                        );
                        $metadatas->associationMappings[$entity->getId()]['joinColumns'][0]['onDelete'] = 'CASCADE';
                    }
                }
            }
        }
    }
public static function loadClassMetadata($eventArgs)
    {
        if ($eventArgs instanceof LoadClassMetadataEventArgs) {
            /** @var ClassMetadata $metadatas */
            $metadatas = $eventArgs->getClassMetadata();
            if ($metadatas->name === 'Victoire\Bundle\CoreBundle\Entity\EntityProxy') {
                foreach (self::$cacheReader->getBusinessClasses() as $entity) {
                    if (!$metadatas->hasAssociation($entity->getId())) {
                        $metadatas->mapOneToOne([
                            'fieldName'    => $entity->getId(),
                            'targetEntity' => $entity->getClass(),
                            'cascade'      => ['persist'],
                            ]
                        );
                        $metadatas->associationMappings[$entity->getId()]['joinColumns'][0]['onDelete'] = 'CASCADE';
                    }
                }
            }
        }
    }
public static function loadClassMetadata ( $ eventArgs ) { if ( $ eventArgs instanceof LoadClassMetadataEventArgs ) { /** @var ClassMetadata $metadatas */ $ metadatas = $ eventArgs -> getClassMetadata ( ) ; if ( $ metadatas -> name === 'Victoire\Bundle\CoreBundle\Entity\EntityProxy' ) { foreach ( self :: $ cacheReader -> getBusinessClasses ( ) as $ entity ) { if ( ! $ metadatas -> hasAssociation ( $ entity -> getId ( ) ) ) { $ metadatas -> mapOneToOne ( [ 'fieldName' => $ entity -> getId ( ) , 'targetEntity' => $ entity -> getClass ( ) , 'cascade' => [ 'persist' ] , ] ) ; $ metadatas -> associationMappings [ $ entity -> getId ( ) ] [ 'joinColumns' ] [ 0 ] [ 'onDelete' ] = 'CASCADE' ; } } } } }
Insert enabled widgets in base widget add relationship between BusinessEntities and EntityProxy.

@param LoadClassMetadataEventArgs $eventArgs
Insert enabled widgets in base widget add relationship between BusinessEntities and EntityProxy .