Bonjour,
J'utilise symfony 4.
Voila je rencontre un petit problème avec mon code.
Je recupere cette reponse plus bas, mon tableau bulding est vide. Achaque requette je voudrais recupere un user tous ces buldings ou un bulding tous ces users.
Voici mes entities
class user{
....
/**
- @var \Doctrine\Common\Collections\Collection
- @ORM\ManyToMany(targetEntity="App\Entity\Bulding", inversedBy="user")
-
@ORM\JoinTable(name="bulding_has_user")
*/
private $bulding;/**
- Constructor
*/
public function __construct()
{
$this->bulding = new \Doctrine\Common\Collections\ArrayCollection();
}
}
class bulding{
/*
@var \Doctrine\Common\Collections\Collection - @ORM\ManyToMany(targetEntity="App\Entity\User", inversedBy="bulding")
-
*/
private $user;/**
- Constructor
*/
public function __construct()
{
$this->user = new \Doctrine\Common\Collections\ArrayCollection();
}
}
votre code pour bien le mettre en forme