我创建了扩展 FOSOAuthServerBundle 的客户端。这个客户端的代码如下:
<?php
namespace Acme\ApiBundle\Entity;
use FOS\OAuthServerBundle\Entity\Client as BaseClient;
use Doctrine\ORM\Mapping as ORM;
/**
* Class Client
*
* @package Acme\ApiBundle\Entity
*
* @ORM\Table("oauth2_clients")
* @ORM\Entity
*/
class Client extends BaseClient
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
protected $name;
public function __construct()
{
parent::__construct();
}
public function setName($name)
{
$this->name = $name;
}
public function getName()
{
return $this->name;
}
}
所以,正如我所说,我扩展了具有 $ randomId的FOSOAuthServerBundle(\friendsofsymfony\oauth-server-bundle\Entity\Client.php,第 28 行)。现在我得到一个错误:
MappingException.php 第 565 行中的 MappingException:字段或鉴别器列映射中实体“Acme\ApiBundle\Entity\Client”上列“random_id”的重复定义。
我哪里错了?