i have two entities 'Panier' and 'Reservation' i want to add a one to many foreign key (the Entity 'Panier' can have many 'Reservation' and 'Reservation' has only one 'Panier' id ) , so i have to add a foreign key 'id' of 'Panier' in my Reservation entity class . this is my Reservation class :
class Reservation { /** * @var integer * * @ORM\Column(name="id", type="integer", nullable=false) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ private $id;
/**
* @var \DateTime
*
* @ORM\Column(name="dateReservation", type="datetime", nullable=false)
*/
private $datereservation = 'CURRENT_TIMESTAMP';
/**
* @var integer
*
* @ORM\Column(name="quantite", type="integer", nullable=false)
*/
private $quantite;
/**
* @var float
*
* @ORM\Column(name="total", type="float", precision=10, scale=0, nullable=true)
*/
private $total;
/**
* @var string
*
* @ORM\Column(name="type", type="string", length=255, nullable=false)
*/
private $type;
/**
* @var string
*
* @ORM\Column(name="seat", type="string", length=255, nullable=false)
*/
private $seat;
/**
* @var integer
*
* @ORM\Column(name="payer", type="integer", nullable=true)
*/
private $payer;
/**
* @var string
*
* @ORM\Column(name="nomReservation", type="string", length=255, nullable=true)
*/
private $nomreservation;
/**
* @var \Event
*
* @ORM\ManyToOne(targetEntity="Event")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="event_id", referencedColumnName="id")
* })
*/
private $event;
/**
* @var \User
*
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
* })
*/
private $user;