当我安装FOSUserBundle( 官方文档 ),我试图生成我的表fos_user
使用这个命令:
php app/console doctrine:schema:update --force
但是,控制台返回以下消息
没有更新 - 您的数据库已在同步与当前实体元
我使用的Symfony 2.1和最后一个版本FOSUserBundle。
应用程序/ AppKernel.php包含
new FOS\UserBundle\FOSUserBundle(),
应用程序/配置/ config.yml包含
fos_user:
db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
firewall_name: main
user_class: Krpano\UserBundle\Entity\User
SRC / Krpano / UserBundle /实体/ user.php的含
namespace Krpano\UserBundle\Entity;
use FOS\UserBundle\Entity\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="pouet")
*/
class User extends BaseUser
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
public function __construct()
{
parent::__construct();
// your own logic
}
}
当我尝试访问我的网站,我有这样的错误:
MappingException:类 'Krpano \ UserBundle \实体\用户' 链中的配置命名空间FOS \ UserBundle \实体,Krpano \ ServicesBundle \实体未发现
你能帮助我吗?