“XXX类不是有效的实体或映射的超类”在文件系统中移动类之后 [英] "Class XXX is not a valid entity or mapped super class" after moving the class in the filesystem
问题描述
我没有尝试通过
php app / console doctrine:generate:form AibPlatformBundle:User
现在我将命名空间更改为Aib\PlatformBundle\Entity\Identity\User,但是当我尝试使用我在
之前所述的任务生成表单时,它说:
类Aib\PlatformBundle\Entity\User不是有效的实体或映射的
超级类。
这是文件内容:
?php
命名空间Aib\PlatformBundle\Entity\Identity;
使用Doctrine\ORM\Mapping作为ORM;
/ **
* Aib\PlatformBundle\Entity\Identity\User
*
* @ ORM\Table()
* @ ORM\Entity(repositoryClass =Aib\PlatformBundle\Entity\Identity
\UserRepository)
* /
类用户
{
...
任何想法?
symfony2.0.4
有问题 - 不要忘记注释 * @ ORM\Entity
如下:
/ **
* Powma\ServiceBundle\Entity\\ \\用户
*
* @ ORM\Entity
* @ ORM\Table(name =users)
* /
I had an entity class in Aib\PlatformBundle\Entity\User.php
I had no problems trying to create its form class through
php app/ console doctrine:generate:form AibPlatformBundle:User
Now I have change the namespace to Aib\PlatformBundle\Entity\Identity\User, but when I try to generate the form with the task I said before it says:
"Class Aib\PlatformBundle\Entity\User is not a valid entity or mapped super class."
This is the file content:
<?php
namespace Aib\PlatformBundle\Entity\Identity;
use Doctrine\ORM\Mapping as ORM;
/**
* Aib\PlatformBundle\Entity\Identity\User
*
* @ORM\Table()
* @ORM\Entity(repositoryClass="Aib\PlatformBundle\Entity\Identity
\UserRepository")
*/
class User
{
...
Any idea?
symfony2.0.4
Had this problem - don't forget the annotation * @ORM\Entity
like below:
/**
* Powma\ServiceBundle\Entity\User
*
* @ORM\Entity
* @ORM\Table(name="users")
*/
这篇关于“XXX类不是有效的实体或映射的超类”在文件系统中移动类之后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!