Symfony 2.7 添加更多 属性 FOSUser 并出现错误
Symfony 2.7 add more property FOSUser and got error
我在 运行 命令
时遇到这个错误
php app/console doctrine:schema:update --force
之前我还为用户实体添加更多 属性 class
[Doctrine\Common\Annotations\AnnotationException]
[Semantical Error] The annotation "@ORM\Entity" in class TL\UserBundle\Entity\User was never imported. Did you maybe forget to add a "use" statement for this annotation?
请帮帮我。
谢谢
嗨@Tan 你检查错误消息建议的内容了吗?
在你的实体 UserBundle\Entity\User 中你有这样的东西吗:
<?php
namespace xxxxBundle\Entity\xxx;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* xxx
*
* @ORM\Table(name="xxx")
* @ORM\Entity(repositoryClass="xxxxBundle\Entity\xxx\xxxRepository")
*/
class xxx
{
如果你没有
use Doctrine\ORM\Mapping as ORM;
Doctrin 抱怨很正常...
我在 运行 命令
时遇到这个错误php app/console doctrine:schema:update --force
之前我还为用户实体添加更多 属性 class
[Doctrine\Common\Annotations\AnnotationException]
[Semantical Error] The annotation "@ORM\Entity" in class TL\UserBundle\Entity\User was never imported. Did you maybe forget to add a "use" statement for this annotation?
请帮帮我。 谢谢
嗨@Tan 你检查错误消息建议的内容了吗?
在你的实体 UserBundle\Entity\User 中你有这样的东西吗:
<?php
namespace xxxxBundle\Entity\xxx;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* xxx
*
* @ORM\Table(name="xxx")
* @ORM\Entity(repositoryClass="xxxxBundle\Entity\xxx\xxxRepository")
*/
class xxx
{
如果你没有
use Doctrine\ORM\Mapping as ORM;
Doctrin 抱怨很正常...