2013-07-04 65 views
0

這樣做後:php app/console doctrine:generate:entities Datacenter錯誤而產生的getter和setter

,我發現了以下錯誤:

[Doctrine\Common\Annotations\AnnotationException] 
    [Semantical Error] The annotation "@validation:Validation" in property Datacenter\AssetsManagerBundle\ 
    Entity\CommentDoc::$name was never imported. Did you maybe forget to add a "use" statement for this an 
    notation? 

順便說一句,我下面的官方文檔http://sonata-project.org/bundles/doctrine-orm-admin/2-0/doc/tutorial/creating_your_first_admin_class/defining_entities.html

它產生吸氣劑和安裝劑時會中斷:p

任何想法? :)

回答

0

的錯誤是明確的:Did you maybe forget to add a "use" statement for this an notation?

添加到這一點您CommentDoc類

use Symfony\Component\Validator\Constraints as validation;

看到http://symfony.com/doc/current/book/validation.html

希望它有助於

最佳方面

+0

索娜taAdmin的文件不太清楚,謝謝,現在是okey;) –