Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ZF2 Doctrine2 setFilterSchemaAssetsExpression setting in the configs

How do I set

$config->setFilterSchemaAssetsExpression($regexp); in my ZF2 Configs?

I do not want to do a --complete and kill my other tables in the db.

'doctrine' => array(
    'configuration' => array(
        'orm_default' => array(
            'numeric_functions' => array(
                'COS'   => 'DoctrineExtensions\Query\Mysql\Cos',
            ),
            'types'             => array(
                'Point' => 'CrEOF\Spatial\DBAL\Types\Geometry\PointType',  
            ),
        ),
    ),
    'eventmanager' => array(
        'orm_default' => array(
            'subscribers' => array(
                'Gedmo\Timestampable\TimestampableListener',
            ),
        ),
    ),
),
like image 951
Chris Avatar asked Dec 01 '25 04:12

Chris


1 Answers

Redefine the ORM ConfigurationFactory in global config.

use DoctrineORMModule\Service\ConfigurationFactory as DoctrineConfigurationFactory;
use Zend\ServiceManager\ServiceLocatorInterface;

return array(
'service_manager' => array(
    'factories' => array(
        'doctrine.configuration.orm_default' => function(ServiceLocatorInterface $serviceLocator) {
            $factory = new DoctrineConfigurationFactory('orm_default');

            /**
             * @var Doctrine\DBAL\Configuration $config
             */
            $config = $factory->createService($serviceLocator);
            $config->setFilterSchemaAssetsExpression('');
            return $config;
        }
    ),
),
);
like image 183
user2434435 Avatar answered Dec 02 '25 18:12

user2434435