找不到Doctrine2 + Zend2存储库类

时间:2014-02-25 16:15:55

标签: class zend-framework doctrine-orm zend-framework2 entity

module.config.php

 'doctrine' => array(
    'driver' => array(
        'Application_driver' => array(
            'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
            'cache' => 'array',
            'paths' => array(__DIR__ . '/../src/Application/Entities')
        ),
        'orm_default' => array(
            'drivers' => array(
                 'Application\Entities' =>  'Application_driver'
            ),
        ),
    ),
),  

Article.php

namespace Application\Entities;

use Doctrine\ORM\Mapping as ORM;

/**
 * Article
 *
 * @ORM\Table(name="article", indexes={@ORM\Index(name="fk_article_gallery1", columns={"gallery_idgallery"}), @ORM\Index(name="fk_article_sf_guard_user1", columns={"sf_guard_user_id"})})
 * @ORM\Entity(repositoryClass="Repositories\ArticleRepository")
 */

ArticleRepository.php位于Application \ Entities \ Repositories \

我收到错误Fatal error: Class 'Repositories\ArticleRepository' not found

我尝试了多条路径,但它不起作用。

我不知道我做错了什么

我也试试

php ./vendor/doctrine/doctrine-module/bin/doctrine-module orm:generate-repositories ./module/Application/src/Application/Entities

它创建了Entities / Repositories / ArticleRepository.php,但我仍然收到错误

0 个答案:

没有答案