Good afternoon.
The following error is occurring:
Error: Duplicate definition of column 'num_user' on entity 'User' in a field or discriminator column mapping.
My User class extends from OwnGroup.
Then the User Class mapping is as follows:
/**
* @Table(name="ge_usuario")
* @Entity
*/
class Usuario extends PossuiGrupo {
/**
* @var integer
*
* @Column(name="numg_usuario", type="integer", nullable=false)
* @Id
* @GeneratedValue(strategy="AUTO")
*/
protected $numgUsuario;
And within the class has group like this:
/**
* @Entity
* @Table(name="ge_grupo_usuario")
*/
class PossuiGrupo extends ModelObject {
/**
* @Id
* @Column(name="numg_usuario", type="integer", nullable=false)
* @ManyToOne(targetEntity="Usuario")
*/
protected $usuario;
/**
* @Id
* @Column(name="numg_grupo", type="integer", nullable=false)
* @ManyToOne(targetEntity="Grupo")
*/
protected $grupo;
public function __construct($usuario, $grupo) {
$this->usuario = $usuario;
$this->grupo = $grupo;
}
Is there any way to work with Doctrine like this, since I can not change the structure of the database.