Commit 7445cbbb authored by Mat's avatar Mat
Browse files

ManyToOne entre Lettre et Offre

parent 80bdeb6b
......@@ -22,6 +22,13 @@ class Lettre
*/
private $id;
/**
* @var int
* @ORM\ManyToOne(targetEntity="PotageBundle\Entity\Offre", inversedBy="lettres")
* @ORM\JoinColumn(name="id_offre", nullable=false)
*/
private $offre;
/**
* @var string
* @ORM\Column(name="reference", type="string", length=16, unique=true)
......@@ -268,4 +275,28 @@ class Lettre
{
return $this->updatedAt;
}
/**
* Set offre
*
* @param \PotageBundle\Entity\Offre $offre
*
* @return Lettre
*/
public function setOffre(\PotageBundle\Entity\Offre $offre)
{
$this->offre = $offre;
return $this;
}
/**
* Get offre
*
* @return \PotageBundle\Entity\Offre
*/
public function getOffre()
{
return $this->offre;
}
}
......@@ -29,6 +29,12 @@ class Offre
*/
private $offreLegumes;
/**
* @var Lettre[]
* @ORM\OneToMany(targetEntity="PotageBundle\Entity\Lettre", mappedBy="offre")
*/
private $lettres;
/**
* @var string
*
......@@ -273,4 +279,38 @@ class Offre
{
return $this->offreLegumes;
}
/**
* Add lettre
*
* @param \PotageBundle\Entity\Lettre $lettre
*
* @return Offre
*/
public function addLettre(\PotageBundle\Entity\Lettre $lettre)
{
$this->lettres[] = $lettre;
return $this;
}
/**
* Remove lettre
*
* @param \PotageBundle\Entity\Lettre $lettre
*/
public function removeLettre(\PotageBundle\Entity\Lettre $lettre)
{
$this->lettres->removeElement($lettre);
}
/**
* Get lettres
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getLettres()
{
return $this->lettres;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment