I am experimenting this error when I execute orm:schema-tool:create. It's my first time with Doctrinem, so I've got several doubts, the one which -I think- causes the error is that I've got a class Player with 3 array of Comment objects. My idea of the db scheme is:
player_comment(id_player,id_comment)
commentsliked(id_player,id_comment)
commentsdisliked(id_player,id_comment)
Notice that comments is a bidirectional relationship although commentsLiked and commentsDisliked are not.
As far as I've understood, Doctrine wants to name the 3 previous tables "player_comment".
Thanks in advance.
My class Player look like this:
/**
* @Entity @Table(name="players")
*/
class Player
{
/**
* @Id @Column(type="integer") @GeneratedValue
* @var int
**/
private $id;
/**
* @OneToMany(targetEntity="Comment", mappedBy="writer")
* @var Comment[]
**/
private $comments = null;
/**
* @ManyToMany(targetEntity="Comment")
* @Table(name="commentsliked")
* @var Comment[]
**/
private $commentsLiked = null;
/**
* @ManyToMany(targetEntity="Comment")
* @Table(name="commentsdisliked")
* @var Comment[]
**/
private $commentDisliked = null;
}
My class Comment look like this:
/**
* @Entity @Table(name="comments")
*/
class Comment {
/**
* @Id @Column(type="integer") @GeneratedValue
* @var int
**/
private $id;
/**
* @ManyToOne(targetEntity="Player", inversedBy="comments")
* @var Player
**/
private $writer;
}