小编Bel*_*los的帖子

如何在ZF2中配置Doctrine文件映射驱动程序

我有这个错误:

致命错误:未捕获的异常'Doctrine\Common\Persistence\Mapping\MappingException'及消息'文件映射驱动程序必须具有有效的目录路径,但是给定路径[path/to/my/entities]似乎不正确

我在我的module.config.php中有这个:

'doctrine' => array(
    'driver' => array(
        // defines an annotation driver with two paths, and names it `my_annotation_driver`
        'my_annotation_driver' => array(
            'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
            'cache' => 'array',
            'paths' => array(
                __DIR__ . '/../src/Realez/Entity',
                'another/path'
            ),
        ),

        // default metadata driver, aggregates all other drivers into a single one.
        // Override `orm_default` only if you know what you're doing
        'orm_default' => array(
            'drivers' => array(
                // register `my_annotation_driver` for any entity under namespace `My\Namespace`
                'Realez/Entity' => 'my_annotation_driver'
            ) …
Run Code Online (Sandbox Code Playgroud)

php doctrine-orm zend-framework2

4
推荐指数
2
解决办法
7881
查看次数

标签 统计

doctrine-orm ×1

php ×1

zend-framework2 ×1