我如何设置
$config->setFilterSchemaAssetsExpression($regexp); 在我的 ZF2 配置中?

我不想对数据库中的其他表执行 --completekill

'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',
            ),
        ),
    ),
),

最佳答案

在全局配置中重新定义 ORM ConfigurationFactory。

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;
        }
    ),
),
);

关于php - 配置中的 ZF2 Doctrine2 setFilterSchemaAssetsExpression 设置,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/21177917/

10-13 06:22