I created client which extends FOSOAuthServerBundle. The code of this client is the following:
<?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;
}
}
So, as I said, I extend the FOSOAuthServerBundle which has $randomId (\friendsofsymfony\oauth-server-bundle\Entity\Client.php, line 28). Now I get an error:
MappingException in MappingException.php line 565: Duplicate definition of column 'random_id' on entity 'Acme\ApiBundle\Entity\Client' in a field or discriminator column mapping.
Where did I a mistake?