public function enhanceEntityManager(Configuration $config, EntityManager $entityManager)
    {
        if (isset($this->settings['doctrine']['dbal']['mappingTypes']) && is_array($this->settings['doctrine']['dbal']['mappingTypes'])) {
            foreach ($this->settings['doctrine']['dbal']['mappingTypes'] as $typeName => $typeConfiguration) {
                if (!Type::hasType($typeName)) {
                    Type::addType($typeName, $typeConfiguration['className']);
                }
                $entityManager->getConnection()->getDatabasePlatform()->registerDoctrineTypeMapping($typeConfiguration['dbType'], $typeName);
            }
        }

        if (isset($this->settings['doctrine']['filters']) && is_array($this->settings['doctrine']['filters'])) {
            foreach ($this->settings['doctrine']['filters'] as $filterName => $filterClass) {
                $config->addFilter($filterName, $filterClass);
                $entityManager->getFilters()->enable($filterName);
            }
        }
    }
public function enhanceEntityManager(Configuration $config, EntityManager $entityManager)
    {
        if (isset($this->settings['doctrine']['dbal']['mappingTypes']) && is_array($this->settings['doctrine']['dbal']['mappingTypes'])) {
            foreach ($this->settings['doctrine']['dbal']['mappingTypes'] as $typeName => $typeConfiguration) {
                if (!Type::hasType($typeName)) {
                    Type::addType($typeName, $typeConfiguration['className']);
                }
                $entityManager->getConnection()->getDatabasePlatform()->registerDoctrineTypeMapping($typeConfiguration['dbType'], $typeName);
            }
        }

        if (isset($this->settings['doctrine']['filters']) && is_array($this->settings['doctrine']['filters'])) {
            foreach ($this->settings['doctrine']['filters'] as $filterName => $filterClass) {
                $config->addFilter($filterName, $filterClass);
                $entityManager->getFilters()->enable($filterName);
            }
        }
    }
public function enhanceEntityManager ( Configuration $ config , EntityManager $ entityManager ) { if ( isset ( $ this -> settings [ 'doctrine' ] [ 'dbal' ] [ 'mappingTypes' ] ) && is_array ( $ this -> settings [ 'doctrine' ] [ 'dbal' ] [ 'mappingTypes' ] ) ) { foreach ( $ this -> settings [ 'doctrine' ] [ 'dbal' ] [ 'mappingTypes' ] as $ typeName => $ typeConfiguration ) { if ( ! Type :: hasType ( $ typeName ) ) { Type :: addType ( $ typeName , $ typeConfiguration [ 'className' ] ) ; } $ entityManager -> getConnection ( ) -> getDatabasePlatform ( ) -> registerDoctrineTypeMapping ( $ typeConfiguration [ 'dbType' ] , $ typeName ) ; } } if ( isset ( $ this -> settings [ 'doctrine' ] [ 'filters' ] ) && is_array ( $ this -> settings [ 'doctrine' ] [ 'filters' ] ) ) { foreach ( $ this -> settings [ 'doctrine' ] [ 'filters' ] as $ filterName => $ filterClass ) { $ config -> addFilter ( $ filterName , $ filterClass ) ; $ entityManager -> getFilters ( ) -> enable ( $ filterName ) ; } } }
Enhance the Doctrine EntityManager by applying post creation settings, like custom filters.

@param Configuration $config
@param EntityManager $entityManager
@throws \Doctrine\DBAL\DBALException
Enhance the Doctrine EntityManager by applying post creation settings like custom filters .