title: Doctrine Relation One-To-Many don't show all results in Synfony 2
body: <p>I'm on Symfony 2.8.15 and I have a problem with a doctrine relation One-To-Many.
  I have an entity InvitesGroupe and an entity Reservations. InvitesGroupe can have One or Many Reservations. So there is a <code>hasReservations()</code> method in.</p>
  
  <p>It works, my application is in production for month. But recently I see a huge result : Not all possibilities are shown. I have an InviteGroupe which have 43 Reservations in the database, all the same format apart the date but only 42 are shown.</p>
  
  <p>If a try the query from the profiler, I have the 43 reservations.</p>
  
  <p>I try many debug, but I don't know what append.</p>
  
  <p>the (owning) InvitesGroupe entities : </p>
  
  <pre><code>&lt;?php
  
  namespace Ipb\AppBundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  use Symfony\Component\Validator\Constraints as Assert;
  
  /**
   * InvitesGroupe
   *
   * @ORM\Table(name="invites_groupe", indexes={@ORM\Index(name="FK_invites_groupe_id_service", columns={"id_service"})})
   * @ORM\Entity(repositoryClass="Ipb\AppBundle\EntityRepository\InvitesGroupeRepository")
   */
  class InvitesGroupe
  {
      /**
       * @var integer
       *
       * @ORM\Column(name="id_invite", type="integer", precision=0, scale=0, nullable=false, unique=false)
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="IDENTITY")
       */
      private $idInvite;
  
      /**
       * @var integer
       *
       * @ORM\Column(name="nombre", type="integer", precision=0, scale=0, nullable=true, unique=false)
       */
      private $nombre;
  
      /**
       * @var string
       *
       * @ORM\Column(name="nom_reservation", type="string", length=30, precision=0, scale=0, nullable=true, unique=false)
       *
       * @Assert\NotBlank()
       * @Assert\Length(max = 30)
       *
       */
      private $nomReservation;
  
      /**
       * @var string
       *
       * @ORM\Column(name="commentaire", type="text", length=65535, precision=0, scale=0, nullable=true, unique=false)
       *
       * @Assert\NotBlank()
       *
       */
      private $commentaire;
  
      /**
       * @var boolean
       *
       * @ORM\Column(name="repas", type="boolean", precision=0, scale=0, nullable=true, unique=false)
       */
      private $repas = 1;
  
      /**
       * @var boolean
       *
       * @ORM\Column(name="repas_offert", type="boolean", precision=0, scale=0, nullable=false, unique=false)
       */
      private $repasOffert = false;
  
      /**
       * @var integer
       *
       * @ORM\Column(name="place_table", type="integer", precision=0, scale=0, nullable=true, unique=false)
       *
       * @Assert\NotBlank()
       *
       */
      private $placeTable;
  
      /**
       * @var boolean
       *
       * @ORM\Column(name="invite_visible", type="boolean", precision=0, scale=0, nullable=false, unique=false)
       */
      private $inviteVisible = true;
  
      /**
       * @var \Ipb\AppBundle\Entity\Users
       *
       * @ORM\ManyToOne(targetEntity="Ipb\AppBundle\Entity\Users")
       * @ORM\JoinColumns({
       *   @ORM\JoinColumn(name="id_user", referencedColumnName="id_user", nullable=true)
       * })
       */
      private $idUser;
  
      /**
       * @var boolean
       *
       * @ORM\Column(name="dessert", type="boolean", precision=0, scale=0, nullable=false, unique=false)
       */
      private $dessert = false;
  
       /**
       * @var boolean
       *
       * @ORM\Column(name="wine", type="boolean", precision=0, scale=0, nullable=false, unique=false)
       */
      private $wine = false;
  
       /**
       * @var boolean
       *
       * @ORM\Column(name="coffee", type="boolean", precision=0, scale=0, nullable=false, unique=false)
       */
      private $coffee = false;
  
      /**
       * @var boolean
       *
       * @ORM\Column(name="invite_temporaire", type="boolean", precision=0, scale=0, nullable=true, unique=false)
       */
      private $inviteTemporaire;
  
      /**
       * @var \Ipb\AppBundle\Entity\Services
       *
       * @ORM\ManyToOne(targetEntity="Ipb\AppBundle\Entity\Services")
       * @ORM\JoinColumns({
       *   @ORM\JoinColumn(name="id_service", referencedColumnName="id_service", nullable=true)
       * })
       */
      private $idService;
  
      /**
       *
       * @ORM\OneToMany(targetEntity="Ipb\AppBundle\Entity\Reservations", mappedBy="invitesGroupe", cascade={"persist","remove"})
       */
      private $reservations;
  
  
  
      /**
       * Get idInvite
       *
       * @return integer 
       */
      public function getIdInvite()
      {
          return $this-&gt;idInvite;
      }
  
      /**
       * Set nombre
       *
       * @param integer $nombre
       * @return InvitesGroupe
       */
      public function setNombre($nombre)
      {
          $this-&gt;nombre = $nombre;
  
          return $this;
      }
  
      /**
       * Get nombre
       *
       * @return integer 
       */
      public function getNombre()
      {
          return $this-&gt;nombre;
      }
  
      /**
       * Set nomReservation
       *
       * @param string $nomReservation
       * @return InvitesGroupe
       */
      public function setNomReservation($nomReservation)
      {
          $this-&gt;nomReservation = $nomReservation;
  
          return $this;
      }
  
      /**
       * Get nomReservation
       *
       * @return string 
       */
      public function getNomReservation()
      {
          return $this-&gt;nomReservation;
      }
  
      /**
       * Set commentaire
       *
       * @param string $commentaire
       * @return InvitesGroupe
       */
      public function setCommentaire($commentaire)
      {
          $this-&gt;commentaire = $commentaire;
  
          return $this;
      }
  
      /**
       * Get commentaire
       *
       * @return string 
       */
      public function getCommentaire()
      {
          return $this-&gt;commentaire;
      }
  
      /**
       * Set repas
       *
       * @param boolean $repas
       * @return InvitesGroupe
       */
      public function setRepas($repas)
      {
          $this-&gt;repas = $repas;
  
          return $this;
      }
  
      /**
       * Get repas
       *
       * @return boolean 
       */
      public function getRepas()
      {
          return $this-&gt;repas;
      }
  
      /**
       * Set repasOffert
       *
       * @param boolean $repasOffert
       * @return InvitesGroupe
       */
      public function setRepasOffert($repasOffert)
      {
          $this-&gt;repasOffert = $repasOffert;
  
          return $this;
      }
  
      /**
       * Get repasOffert
       *
       * @return boolean 
       */
      public function getRepasOffert()
      {
          return $this-&gt;repasOffert;
      }
  
      /**
       * Set placeTable
       *
       * @param integer $placeTable
       * @return InvitesGroupe
       */
      public function setPlaceTable($placeTable)
      {
          $this-&gt;placeTable = $placeTable;
  
          return $this;
      }
  
      /**
       * Get placeTable
       *
       * @return integer 
       */
      public function getPlaceTable()
      {
          return $this-&gt;placeTable;
      }
  
      /**
       * Set inviteVisible
       *
       * @param boolean $inviteVisible
       * @return InvitesGroupe
       */
      public function setInviteVisible($inviteVisible)
      {
          $this-&gt;inviteVisible = $inviteVisible;
  
          return $this;
      }
  
      /**
       * Get inviteVisible
       *
       * @return boolean 
       */
      public function getInviteVisible()
      {
          return $this-&gt;inviteVisible;
      }
  
      /**
       * Set dessert
       *
       * @param boolean $dessert
       * @return InvitesGroupe
       */
      public function setDessert($dessert)
      {
          $this-&gt;dessert = $dessert;
  
          return $this;
      }
  
      /**
       * Get dessert
       *
       * @return boolean 
       */
      public function getDessert()
      {
          return $this-&gt;dessert;
      }
  
      /**
       * Set idService
       *
       * @param \Ipb\AppBundle\Entity\Services $idService
       * @return InvitesGroupe
       */
      public function setIdService(\Ipb\AppBundle\Entity\Services $idService = null)
      {
          $this-&gt;idService = $idService;
  
          return $this;
      }
  
      /**
       * Get idService
       *
       * @return \Ipb\AppBundle\Entity\Services 
       */
      public function getIdService()
      {
          return $this-&gt;idService;
      }
  
      /**
       * Constructor
       */
      public function __construct()
      {
          $this-&gt;reservations = new \Doctrine\Common\Collections\ArrayCollection();
      }
  
      /**
       * Add reservations
       *
       * @param \Ipb\AppBundle\Entity\Reservations $reservations
       * @return Reservations
       */
      public function addReservation(\Ipb\AppBundle\Entity\Reservations $reservations)
      {
          $this-&gt;reservations[] = $reservations;
  
          return $this;
      }
  
      /**
       * Remove reservations
       *
       * @param \Ipb\AppBundle\Entity\Reservations $reservations
       */
      public function removeReservation(\Ipb\AppBundle\Entity\Reservations $reservations)
      {
          $this-&gt;reservations-&gt;removeElement($reservations);
      }
  
      /**
       * Get reservations
       *
       * @return \Doctrine\Common\Collections\Collection 
       */
      public function getReservations()
      {
          return $this-&gt;reservations;
      }
  
      /**
       * Set inviteTemporaire
       *
       * @param boolean $inviteTemporaire
       *
       * @return InvitesGroupe
       */
      public function setInviteTemporaire($inviteTemporaire)
      {
          $this-&gt;inviteTemporaire = $inviteTemporaire;
  
          return $this;
      }
  
      /**
       * Get inviteTemporaire
       *
       * @return boolean
       */
      public function getInviteTemporaire()
      {
          return $this-&gt;inviteTemporaire;
      }
  
      /**
       * Set wine
       *
       * @param boolean $wine
       *
       * @return InvitesGroupe
       */
      public function setWine($wine)
      {
          $this-&gt;wine = $wine;
  
          return $this;
      }
  
      /**
       * Get wine
       *
       * @return boolean
       */
      public function getWine()
      {
          return $this-&gt;wine;
      }
  
      /**
       * Set coffee
       *
       * @param boolean $coffee
       *
       * @return InvitesGroupe
       */
      public function setCoffee($coffee)
      {
          $this-&gt;coffee = $coffee;
  
          return $this;
      }
  
      /**
       * Get coffee
       *
       * @return boolean
       */
      public function getCoffee()
      {
          return $this-&gt;coffee;
      }
  
      /**
       * Set idUser
       *
       * @param \Ipb\AppBundle\Entity\Users $idUser
       *
       * @return InvitesGroupe
       */
      public function setIdUser(\Ipb\AppBundle\Entity\Users $idUser = null)
      {
          $this-&gt;idUser = $idUser;
  
          return $this;
      }
  
      /**
       * Get idUser
       *
       * @return \Ipb\AppBundle\Entity\Users
       */
      public function getIdUser()
      {
          return $this-&gt;idUser;
      }
  }
  </code></pre>
  
  <p>and the Reservations entity :</p>
  
  <pre><code>&lt;?php
  
  namespace Ipb\AppBundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  
  /**
   * Reservations
   *
   * @ORM\Table(name="reservations", indexes={@ORM\Index(name="FK_reservations_id_invite", columns={"id_invite"}), @ORM\Index(name="FK_reservations_id_service", columns={"id_service"}), @ORM\Index(name="FK_reservations_id_restaurant", columns={"id_restaurant"}), @ORM\Index(name="FK_reservations_id_groupe_personnel", columns={"id_groupe_personnel"}), @ORM\Index(name="FK_reservations_id_classe", columns={"id_classe"}), @ORM\Index(name="FK_reservations_id_groupe", columns={"id_groupe"}), @ORM\Index(name="key_date_resa", columns={"date"})})
   * @ORM\HasLifecycleCallbacks
   * @ORM\Entity(repositoryClass="Ipb\AppBundle\EntityRepository\ReservationsRepository")
   */
  class Reservations
  {
      /**
       * @var integer
       *
       * @ORM\Column(name="id_reservation", type="integer", precision=0, scale=0, nullable=false, unique=false)
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="IDENTITY")
       */
      private $idReservation;
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="date", type="date", precision=0, scale=0, nullable=true, unique=false)
       */
      private $date;
  
      /**
       * @var integer
       *
       * @ORM\Column(name="nb_place", type="integer", precision=0, scale=0, nullable=true, unique=false)
       */
      private $nbPlace;
  
      /**
       * @var float
       *
       * @ORM\Column(name="cout_total", type="float", precision=10, scale=0, nullable=true, unique=false)
       */
      private $coutTotal;
  
      /**
       * @var boolean
       *
       * @ORM\Column(name="repas_compris", type="boolean", precision=0, scale=0, nullable=true, unique=false)
       */
      private $repasCompris;
  
      /**
       * @var \Ipb\AppBundle\Entity\GroupesPersonnels
       *
       * @ORM\ManyToOne(targetEntity="Ipb\AppBundle\Entity\GroupesPersonnels")
       * @ORM\JoinColumns({
       *   @ORM\JoinColumn(name="id_groupe_personnel", referencedColumnName="id_groupe_personnel", nullable=true)
       * })
       */
      private $idGroupePersonnel;
  
      /**
       * @var integer
       *
       * @ORM\Column(name="incertain", type="integer", precision=0, scale=0, nullable=true, unique=false)
       */
      private $incertain;
  
      /**
       * @var \Ipb\AppBundle\Entity\Classes
       *
       * @ORM\ManyToOne(targetEntity="Ipb\AppBundle\Entity\Classes")
       * @ORM\JoinColumns({
       *   @ORM\JoinColumn(name="id_classe", referencedColumnName="id_classe", nullable=true)
       * })
       */
      private $idClasse;
  
      /**
       * @var \Ipb\AppBundle\Entity\Groupes
       *
       * @ORM\ManyToOne(targetEntity="Ipb\AppBundle\Entity\Groupes")
       * @ORM\JoinColumns({
       *   @ORM\JoinColumn(name="id_groupe", referencedColumnName="id_groupe", nullable=true)
       * })
       */
      private $idGroupe;
  
      /**
       * @var \Ipb\AppBundle\Entity\InvitesGroupe
       *
       * @ORM\ManyToOne(targetEntity="Ipb\AppBundle\Entity\InvitesGroupe")
       * @ORM\JoinColumns({
       *   @ORM\JoinColumn(name="id_invite", referencedColumnName="id_invite", nullable=true)
       * })
       */
      private $idInvite;
  
      /**
       * @var \Ipb\AppBundle\Entity\Restaurants
       *
       * @ORM\ManyToOne(targetEntity="Ipb\AppBundle\Entity\Restaurants")
       * @ORM\JoinColumns({
       *   @ORM\JoinColumn(name="id_restaurant", referencedColumnName="id_restaurant", nullable=true)
       * })
       */
      private $idRestaurant;
  
      /**
       * @var \Ipb\AppBundle\Entity\Services
       *
       * @ORM\ManyToOne(targetEntity="Ipb\AppBundle\Entity\Services")
       * @ORM\JoinColumns({
       *   @ORM\JoinColumn(name="id_service", referencedColumnName="id_service", nullable=true)
       * })
       */
      private $idService;
  
       /**
       * 
       * @ORM\ManyToOne(targetEntity="Ipb\AppBundle\Entity\InvitesGroupe", inversedBy="reservations", cascade={"persist"})
       * @ORM\JoinColumn(name="id_invite", referencedColumnName="id_invite", onDelete="CASCADE")
       */
      private $invitesGroupe;
  
  
  
      /**
       * Get idReservation
       *
       * @return integer 
       */
      public function getIdReservation()
      {
          return $this-&gt;idReservation;
      }
  
      /**
       * Set date
       *
       * @param \DateTime $date
       * @return Reservations
       */
      public function setDate($date)
      {
          $this-&gt;date = $date;
  
          return $this;
      }
  
      /**
       * Get date
       *
       * @return \DateTime 
       */
      public function getDate()
      {
          return $this-&gt;date;
      }
  
      /**
       * Set nbPlace
       *
       * @param integer $nbPlace
       * @return Reservations
       */
      public function setNbPlace($nbPlace)
      {
          $this-&gt;nbPlace = $nbPlace;
  
          return $this;
      }
  
      /**
       * Get nbPlace
       *
       * @return integer 
       */
      public function getNbPlace()
      {
          return $this-&gt;nbPlace;
      }
  
      /**
       * Set coutTotal
       *
       * @param float $coutTotal
       * @return Reservations
       */
      public function setCoutTotal($coutTotal)
      {
          $this-&gt;coutTotal = $coutTotal;
  
          return $this;
      }
  
      /**
       * Get coutTotal
       *
       * @return float 
       */
      public function getCoutTotal()
      {
          return $this-&gt;coutTotal;
      }
  
      /**
       * Set repasCompris
       *
       * @param boolean $repasCompris
       * @return Reservations
       */
      public function setRepasCompris($repasCompris)
      {
          $this-&gt;repasCompris = $repasCompris;
  
          return $this;
      }
  
      /**
       * Get repasCompris
       *
       * @return boolean 
       */
      public function getRepasCompris()
      {
          return $this-&gt;repasCompris;
      }
  
      /**
       * Set idGroupePersonnel
       *
       * @param integer $idGroupePersonnel
       * @return Reservations
       */
      public function setIdGroupePersonnel($idGroupePersonnel)
      {
          $this-&gt;idGroupePersonnel = $idGroupePersonnel;
  
          return $this;
      }
  
      /**
       * Get idGroupePersonnel
       *
       * @return integer 
       */
      public function getIdGroupePersonnel()
      {
          return $this-&gt;idGroupePersonnel;
      }
  
      /**
       * Set incertain
       *
       * @param integer $incertain
       * @return Reservations
       */
      public function setIncertain($incertain)
      {
          $this-&gt;incertain = $incertain;
  
          return $this;
      }
  
      /**
       * Get incertain
       *
       * @return integer 
       */
      public function getIncertain()
      {
          return $this-&gt;incertain;
      }
  
      /**
       * Set idClasse
       *
       * @param \Ipb\AppBundle\Entity\Classes $idClasse
       * @return Reservations
       */
      public function setIdClasse(\Ipb\AppBundle\Entity\Classes $idClasse = null)
      {
          $this-&gt;idClasse = $idClasse;
  
          return $this;
      }
  
      /**
       * Get idClasse
       *
       * @return \Ipb\AppBundle\Entity\Classes 
       */
      public function getIdClasse()
      {
          return $this-&gt;idClasse;
      }
  
      /**
       * Set idGroupe
       *
       * @param \Ipb\AppBundle\Entity\Groupes $idGroupe
       * @return Reservations
       */
      public function setIdGroupe(\Ipb\AppBundle\Entity\Groupes $idGroupe = null)
      {
          $this-&gt;idGroupe = $idGroupe;
  
          return $this;
      }
  
      /**
       * Get idGroupe
       *
       * @return \Ipb\AppBundle\Entity\Groupes 
       */
      public function getIdGroupe()
      {
          return $this-&gt;idGroupe;
      }
  
      /**
       * Set idInvite
       *
       * @param \Ipb\AppBundle\Entity\InvitesGroupe $idInvite
       * @return Reservations
       */
      public function setIdInvite(\Ipb\AppBundle\Entity\InvitesGroupe $idInvite = null)
      {
          $this-&gt;idInvite = $idInvite;
  
          return $this;
      }
  
      /**
       * Get idInvite
       *
       * @return \Ipb\AppBundle\Entity\InvitesGroupe 
       */
      public function getIdInvite()
      {
          return $this-&gt;idInvite;
      }
  
      /**
       * Set idRestaurant
       *
       * @param \Ipb\AppBundle\Entity\Restaurants $idRestaurant
       * @return Reservations
       */
      public function setIdRestaurant(\Ipb\AppBundle\Entity\Restaurants $idRestaurant = null)
      {
          $this-&gt;idRestaurant = $idRestaurant;
  
          return $this;
      }
  
      /**
       * Get idRestaurant
       *
       * @return \Ipb\AppBundle\Entity\Restaurants 
       */
      public function getIdRestaurant()
      {
          return $this-&gt;idRestaurant;
      }
  
      /**
       * Set idService
       *
       * @param \Ipb\AppBundle\Entity\Services $idService
       * @return Reservations
       */
      public function setIdService(\Ipb\AppBundle\Entity\Services $idService = null)
      {
          $this-&gt;idService = $idService;
  
          return $this;
      }
  
      /**
       * Get idService
       *
       * @return \Ipb\AppBundle\Entity\Services 
       */
      public function getIdService()
      {
          return $this-&gt;idService;
      }
  
  
      /**
       * Set invitesGroupe
       *
       * @param \Ipb\AppBundle\Entity\InvitesGroupe $invitesGroupe
       * @return Reservations
       */
      public function setInvitesGroupes(\Ipb\AppBundle\Entity\InvitesGroupe $invitesGroupe = null)
      {
          $this-&gt;invitesGroupe = $invitesGroupe;
  
          return $this;
      }
  
      /**
       * Get invitesGroupes
       *
       * @return \Ipb\AppBundle\Entity\InvitesGroupes
       */
      public function getInvitesGroupe()
      {
          return $this-&gt;invitesGroupe;
      }
  }
  </code></pre>
  
  <p>the controller :</p>
  
  <pre><code>/**
       * Lists all InvitesGroupe entities.
       *
       * @Route("/", name="invitesgroupe_index")
       * @Method("GET")
       */
      public function indexAction(Request $request)
      {
  
          $em = $this-&gt;getDoctrine()-&gt;getManager();
  
          $day = $request-&gt;get('day');
          $resto = $request-&gt;get('resto');
  
          $user = !$this-&gt;get('security.authorization_checker')-&gt;isGranted('ROLE_SUPERVISEUR') ? "AND ig.idUser = '".$this-&gt;get('security.context')-&gt;getToken()-&gt;getUser()-&gt;getIdUser()."'" : "";
  
          if($day){
              $day = \DateTime::createFromFormat('d/m/Y', $day);
              $dql   = "SELECT ig FROM IpbAppBundle:InvitesGroupe ig 
                      LEFT JOIN IpbAppBundle:Reservations r WITH r.idInvite = ig.idInvite
                      WHERE ig.inviteVisible = 1
                      AND ig.inviteTemporaire IS NULL
                      AND r.date = '".$day-&gt;format('Y-m-d')."'
                      ".$user."
                      ORDER BY ig.idInvite DESC";
          }else if($resto &amp;&amp; $day){
              $day = \DateTime::createFromFormat('d/m/Y', $day);
              $dql   = "SELECT ig FROM IpbAppBundle:InvitesGroupe ig 
                      LEFT JOIN IpbAppBundle:Reservations r WITH r.idInvite = ig.idInvite
                      WHERE ig.inviteVisible = 1 AND ig.inviteTemporaire IS NULL
                      AND r.idRestaurant = ".$resto."
                      AND r.date = '".$day-&gt;format('Y-m-d')."'
                      ".$user."
                      ORDER BY ig.idInvite DESC";
  
          }else{
              $dql   = "SELECT ig FROM IpbAppBundle:InvitesGroupe ig
                      LEFT JOIN IpbAppBundle:Reservations r WITH r.idInvite = ig.idInvite
                      WHERE ig.inviteVisible = 1 AND ig.inviteTemporaire IS NULL
                      AND r.date &gt;= CURRENT_TIMESTAMP()
                      ".$user."
                      ORDER BY ig.idInvite DESC";
          }
  
          $query = $em-&gt;createQuery($dql);
  
  
          $paginator  = $this-&gt;get('knp_paginator');
          $pagination = $paginator-&gt;paginate(
              $query, /* query NOT result */
              $request-&gt;query-&gt;getInt('page', 1)/*page number*/,
              10/*limit per page*/
          );
  
          $deleteForms = array();
  
          if(null !== $request-&gt;get('print')){
              return $pagination;
          }
  
          foreach ($pagination as $page) {
              $deleteForms[$page-&gt;getIdInvite()] = $this-&gt;createDeleteForm($page)-&gt;createView();
          }
  
          if($day){
              $restoTest = array();
              $restos = array();
              foreach ($pagination as $invite) {
                  if(!in_array($invite-&gt;getIdService()-&gt;getIdRestaurant()-&gt;getIdRestaurant(), $restoTest)){
                      $obj = new \stdClass();
                      $obj-&gt;id = $invite-&gt;getIdService()-&gt;getIdRestaurant()-&gt;getIdRestaurant();
                      $obj-&gt;nom = $invite-&gt;getIdService()-&gt;getIdRestaurant()-&gt;getNomRestaurant();
                      $restos[] = $obj;
                      $restoTest[] = $invite-&gt;getIdService()-&gt;getIdRestaurant()-&gt;getIdRestaurant();
  
                  }
              }
          }
  
  
  
          return $this-&gt;render('invitesgroupe/index.html.twig', array(
              'invitesGroupes' =&gt;  $pagination, 
              'delete_forms' =&gt; $deleteForms,
              'day'  =&gt; $day ? $day : null,
              'restos' =&gt; isset($restos) ? json_encode($restos) : null
          ));
      }
  </code></pre>