private function addRegisterMappingsPass(ContainerBuilder $container)
    {
        $easyAdminExtensionBundleRefl = new \ReflectionClass($this);

        if ($easyAdminExtensionBundleRefl->isUserDefined()) {
            $easyAdminExtensionBundlePath = \dirname((string) $easyAdminExtensionBundleRefl->getFileName());
            $easyAdminExtensionDoctrineMapping = $easyAdminExtensionBundlePath.'/Resources/config/doctrine-mapping';

            $mappings = [
                \realpath($easyAdminExtensionDoctrineMapping) => 'AlterPHP\EasyAdminExtensionBundle\Model',
            ];
            if (\class_exists(DoctrineOrmMappingsPass::class)) {
                $container->addCompilerPass(DoctrineOrmMappingsPass::createXmlMappingDriver($mappings));
            }
        }
    }
private function addRegisterMappingsPass(ContainerBuilder $container)
    {
        $easyAdminExtensionBundleRefl = new \ReflectionClass($this);

        if ($easyAdminExtensionBundleRefl->isUserDefined()) {
            $easyAdminExtensionBundlePath = \dirname((string) $easyAdminExtensionBundleRefl->getFileName());
            $easyAdminExtensionDoctrineMapping = $easyAdminExtensionBundlePath.'/Resources/config/doctrine-mapping';

            $mappings = [
                \realpath($easyAdminExtensionDoctrineMapping) => 'AlterPHP\EasyAdminExtensionBundle\Model',
            ];
            if (\class_exists(DoctrineOrmMappingsPass::class)) {
                $container->addCompilerPass(DoctrineOrmMappingsPass::createXmlMappingDriver($mappings));
            }
        }
    }
private function addRegisterMappingsPass ( ContainerBuilder $ container ) { $ easyAdminExtensionBundleRefl = new \ ReflectionClass ( $ this ) ; if ( $ easyAdminExtensionBundleRefl -> isUserDefined ( ) ) { $ easyAdminExtensionBundlePath = \ dirname ( ( string ) $ easyAdminExtensionBundleRefl -> getFileName ( ) ) ; $ easyAdminExtensionDoctrineMapping = $ easyAdminExtensionBundlePath . '/Resources/config/doctrine-mapping' ; $ mappings = [ \ realpath ( $ easyAdminExtensionDoctrineMapping ) => 'AlterPHP\EasyAdminExtensionBundle\Model' , ] ; if ( \ class_exists ( DoctrineOrmMappingsPass :: class ) ) { $ container -> addCompilerPass ( DoctrineOrmMappingsPass :: createXmlMappingDriver ( $ mappings ) ) ; } } }
Register storage mapping for model-based persisted objects from EasyAdminExtension.
Much inspired from FOSUserBundle implementation.

@see  https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/FOSUserBundle.php

@param ContainerBuilder $container

@throws \ReflectionException
Register storage mapping for model - based persisted objects from EasyAdminExtension . Much inspired from FOSUserBundle implementation .