0

这样做之后:php app/console doctrine:generate:entities Datacenter

我收到以下错误:

  [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

它在生成 getter 和 setter 时会中断:p

有任何想法吗 ?:)

4

1 回答 1

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

希望它有帮助

最良好的问候

于 2013-07-04T17:13:09.423 回答