我有两个实体,一个用于预订,另一个用于可以预订的桌子.此实体具有ManyToMany关系.当我尝试验证此架构时,我收到以下错误:
我能帮忙解决这个问题吗?我无法弄清楚我做错了什么.
表实体:
/**
*
* @ORM\Entity
* @ORM\Table(name="tables")
* @ORM\Entity(repositoryClass="Test\TestBundle\Repository\TableRepository")
*/
class Table {
/**
* @var integer $id
* @ORM\ID
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="integer", length=3)
*/
protected $nmbr;
/**
* @ORM\ManyToMany(targetEntity="Reservation", mappedBy="tables", cascade={"persist"})
*/
private $reservations;
public function addReservation($reservation) {
$reservation->addTable($this);
$this->reservations[] = $reservation;
}
public function getId() {
return $this->id;
}
public function getNmbr() {
return $this->nmbr;
}
public function getReservations() {
return $this->reservations;
}
public …Run Code Online (Sandbox Code Playgroud)