public function loadClassMetadata(LoadClassMetadataEventArgs $args)
    {
        $classMetadata = $args->getClassMetadata();

        if ($classMetadata->isInheritanceTypeSingleTable() && !$classMetadata->isRootEntity()) {
            return;
        }

        if ($classMetadata->getReflectionClass() && $classMetadata->getReflectionClass()->implementsInterface('Ekino\\WordpressBundle\\Model\\WordpressEntityInterface')) {
            $classMetadata->setPrimaryTable(['name' => $this->prefix.$classMetadata->getTableName()]);

            foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) {
                if ($mapping['type'] == ClassMetadataInfo::MANY_TO_MANY) {
                    $mappedTableName = $classMetadata->associationMappings[$fieldName]['joinTable']['name'];
                    $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->prefix.$mappedTableName;
                }
            }
        }
    }
public function loadClassMetadata(LoadClassMetadataEventArgs $args)
    {
        $classMetadata = $args->getClassMetadata();

        if ($classMetadata->isInheritanceTypeSingleTable() && !$classMetadata->isRootEntity()) {
            return;
        }

        if ($classMetadata->getReflectionClass() && $classMetadata->getReflectionClass()->implementsInterface('Ekino\\WordpressBundle\\Model\\WordpressEntityInterface')) {
            $classMetadata->setPrimaryTable(['name' => $this->prefix.$classMetadata->getTableName()]);

            foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) {
                if ($mapping['type'] == ClassMetadataInfo::MANY_TO_MANY) {
                    $mappedTableName = $classMetadata->associationMappings[$fieldName]['joinTable']['name'];
                    $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->prefix.$mappedTableName;
                }
            }
        }
    }
public function loadClassMetadata ( LoadClassMetadataEventArgs $ args ) { $ classMetadata = $ args -> getClassMetadata ( ) ; if ( $ classMetadata -> isInheritanceTypeSingleTable ( ) && ! $ classMetadata -> isRootEntity ( ) ) { return ; } if ( $ classMetadata -> getReflectionClass ( ) && $ classMetadata -> getReflectionClass ( ) -> implementsInterface ( 'Ekino\\WordpressBundle\\Model\\WordpressEntityInterface' ) ) { $ classMetadata -> setPrimaryTable ( [ 'name' => $ this -> prefix . $ classMetadata -> getTableName ( ) ] ) ; foreach ( $ classMetadata -> getAssociationMappings ( ) as $ fieldName => $ mapping ) { if ( $ mapping [ 'type' ] == ClassMetadataInfo :: MANY_TO_MANY ) { $ mappedTableName = $ classMetadata -> associationMappings [ $ fieldName ] [ 'joinTable' ] [ 'name' ] ; $ classMetadata -> associationMappings [ $ fieldName ] [ 'joinTable' ] [ 'name' ] = $ this -> prefix . $ mappedTableName ; } } } }
Loads class metadata and updates table prefix name.

@param LoadClassMetadataEventArgs $args
Loads class metadata and updates table prefix name .