2012-03-11 9 views
5

私は、zend mvcを、bisnaドライバと一緒にバインドされたdoctrine 2.1と2.2とともに使用するのに慣れています。Bisna doctrine 2.1&2.2注釈「@Table」は決してインポートされませんでした

[Semantical Error] The annotation "@Table" in class MyWheels\Entity\Bmulog was never imported. 
を:私は(私はthout).How私は私のエンティティのデータベースから生成し、それらをロードしようと試みたが、彼らはエラーを生成維持しましたこれまでちょうどconvenianceのための注釈ドライバを使用している新しいプロジェクトの

ORM \プレフィックスを追加しようとしましたが、解決しません。

私の設定ファイルの読み込みの:

[production] 
phpSettings.display_startup_errors = 0 
phpSettings.display_errors = 0 
includePaths.library = APPLICATION_PATH "/../library" 
bootstrap.path = APPLICATION_PATH "/Bootstrap.php" 
bootstrap.class = "Bootstrap" 
appnamespace = "Application" 

pluginPaths.Bisna\Application\Resource\ = "Bisna/Application/Resource" 
autoloaderNamespaces[] = Bisna 
autoloaderNamespaces[] = Doctrine 
autoloaderNamespaces[] = MyWheels 
autoloaderNamespaces[] = Symfony 

resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" 
resources.frontController.params.displayExceptions = 0 

resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/" 

resources.doctrine.cache.instances.default.namespace = "Application_" 
resources.doctrine.dbal.connections.default.parameters.dbname = "mywheels" 
resources.doctrine.dbal.connections.default.parameters.user = "root" 
resources.doctrine.dbal.connections.default.parameters.password = "" 
resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.adapterClass = "Doctrine\ORM\Mapping\Driver\AnnotationDriver" 
resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.mappingNamespace = "MyWheels\Entity" 
resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.mappingDirs[] = APPLICATION_PATH "\..\library\MyWheels\Entity" 
resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.annotationReaderClass = "Doctrine\Common\Annotations\AnnotationReader" 

誰もここで間違って何が起こっているの任意の手掛かり?

私のエンティティのコードは次のとおりです。

<?php 

namespace MyWheels\Entity; 

use Doctrine\ORM\Mapping as ORM; 

/** 
* MyWheels\Entity\Bmulog 
* 
* @Table(name="bmulog") 
* @Entity 
*/ 
class Bmulog 
{ 
    /** 
    * @var integer $id 
    * 
    * @Column(name="id", type="integer", nullable=false) 
    * @Id 
    * @GeneratedValue(strategy="IDENTITY") 
    */ 
    private $id; 

    /** 
    * @var text $request 
    * 
    * @Column(name="request", type="text", nullable=false) 
    */ 
    private $request; 

    /** 
    * @var text $responce 
    * 
    * @Column(name="responce", type="text", nullable=false) 
    */ 
    private $responce; 

    /** 
    * @var string $ip 
    * 
    * @Column(name="ip", type="string", length=200, nullable=false) 
    */ 
    private $ip; 

    /** 
    * @var string $browser 
    * 
    * @Column(name="browser", type="string", length=200, nullable=false) 
    */ 
    private $browser; 

    /** 
    * @var datetime $date 
    * 
    * @Column(name="date", type="datetime", nullable=false) 
    */ 
    private $date; 


} 

教義2.2.0同じエラーについてで結果:

[Semantical Error] The annotation "@Doctrine\ORM\Mapping\Table" in class MyWheels\Entity\Bmulog does not exist, or could not be auto-loaded. 
+2

は役立つかもしれない - https://github.com/guilhermeblanco/ZendFramework1-Doctrine2/issues/24を – Phil

+0

それはbasiclyはいを述べている:D。私は今、いくつかのデフォルトのlibで2.0の教義を使用しています。どこで動作しているのか分かりました。しかし、なぜそれが間違っているのか分かりません – Bram

答えて

5

使用Doctrine\ORM\MappingはDoctrineの注釈タグの接頭辞として輸入別名を追加暗示。

@ORM\Table 
@ORM\Entity 
@ORM\Column 
@ORM\... (Any Doctrine annotation) 
関連する問題