【发布时间】:2011-12-21 04:14:36
【问题描述】:
当我尝试清除缓存时出现此错误(例如):
[Doctrine\ORM\Mapping\MappingException] 类 Aib\PlatformBundle\Entity\User 不是有效实体或映射的超级 类。
这是 User.php:
<?php
// src/Aib/PlatformBundle/Entity/User.php
namespace Aib\PlatformBundle\Entity;
use FOS\UserBundle\Entity\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="fos_user")
*/
class User extends BaseUser
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
public function __construct()
{
parent::__construct();
// your own logic
}
}
而这里是存放User.php的地方:
javier@javier:~/programacion/aib/src/Aib/PlatformBundle/Entity$ ls User.php UserRepository.php
这是 AppKernel.php:
public function registerBundles()
{
$bundles = array(
...
new Aib\PlatformBundle\AibPlatformBundle(),
...
);
sf 2.0.4
【问题讨论】:
-
你是否在你的 app/config.yml 中设置了实体映射来自动加载?
-
为什么不回答有问题的问题?
-
InvalidConfigurationException: Unrecognized options "auto_mapping" under "doctrine.orm" 我在 symfony 2.1-BETA 中遇到了这样的异常
标签: symfony