Commit ea2e9453 authored by Mat's avatar Mat

API queries, pose des limites de profondeurs dans les entités

parent 7cb09523
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace PotageBundle\Entity; namespace PotageBundle\Entity;
use JMS\Serializer\Annotation\MaxDepth;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
...@@ -27,6 +28,7 @@ class Info ...@@ -27,6 +28,7 @@ class Info
/** /**
* @var int * @var int
* @ORM\ManyToMany(targetEntity="PotageBundle\Entity\Lettre", mappedBy="infos") * @ORM\ManyToMany(targetEntity="PotageBundle\Entity\Lettre", mappedBy="infos")
* @MaxDepth(3)
*/ */
private $lettres; private $lettres;
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace PotageBundle\Entity; namespace PotageBundle\Entity;
use JMS\Serializer\Annotation\MaxDepth;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
...@@ -27,6 +28,7 @@ class Lettre ...@@ -27,6 +28,7 @@ class Lettre
* @var int * @var int
* @ORM\ManyToOne(targetEntity="PotageBundle\Entity\Offre", inversedBy="lettres") * @ORM\ManyToOne(targetEntity="PotageBundle\Entity\Offre", inversedBy="lettres")
* @ORM\JoinColumn(name="id_offre", nullable=false) * @ORM\JoinColumn(name="id_offre", nullable=false)
* @MaxDepth(2)
*/ */
private $offre; private $offre;
...@@ -44,6 +46,7 @@ class Lettre ...@@ -44,6 +46,7 @@ class Lettre
* @var int * @var int
* @ORM\ManyToOne(targetEntity="PotageBundle\Entity\Groupe", inversedBy="lettres") * @ORM\ManyToOne(targetEntity="PotageBundle\Entity\Groupe", inversedBy="lettres")
* @ORM\JoinColumn(name="id_groupe", nullable=false) * @ORM\JoinColumn(name="id_groupe", nullable=false)
* @MaxDepth(2)
*/ */
private $groupe; private $groupe;
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace PotageBundle\Entity; namespace PotageBundle\Entity;
use JMS\Serializer\Annotation\MaxDepth;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
...@@ -27,12 +28,14 @@ class Offre ...@@ -27,12 +28,14 @@ class Offre
/** /**
* @var OffreLegumes[] * @var OffreLegumes[]
* @ORM\OneToMany(targetEntity="PotageBundle\Entity\OffreLegumes", mappedBy="offre") * @ORM\OneToMany(targetEntity="PotageBundle\Entity\OffreLegumes", mappedBy="offre")
* @MaxDepth(2)
*/ */
private $offreLegumes; private $offreLegumes;
/** /**
* @var Lettre[] * @var Lettre[]
* @ORM\OneToMany(targetEntity="PotageBundle\Entity\Lettre", mappedBy="offre") * @ORM\OneToMany(targetEntity="PotageBundle\Entity\Lettre", mappedBy="offre")
* @MaxDepth(2)
*/ */
private $lettres; private $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