bonjour j'ai un tableau
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| (array) [Number of elements: 2]
0:
(array) [Number of elements: 9]
nom: (string) lefebvre
prenom: (string) Jean Claude
fonction: (string) dz
codebar: (string) 1
email: (string) nlefebvre@gmx.fr
lang: (string) dz
pays: (string) zd
choix: (string) dz
hebergement: (string) 1
1:
(array) [Number of elements: 9]
nom: (string) lefebvre
prenom: (string) nicolas
fonction: (string) dz
codebar: (string) 1
email: (string) nlefebvre@gmx.fr
lang: (string) zd
pays: (string) zd
choix: (string) dz
hebergement: (string) 1 |
$parti = au tableau dessus
je veux le passé en relation :
$matable->addParticipant( $parti);
dans $matable j'ai:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
/**
*
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Participants",mappedBy="accreditation", cascade={"persist", "remove"})
*/
protected $participants;
/**
* Constructor
*/
public function __construct()
{
$this->participants = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get participants
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getParticipants()
{
return $this->participants;
}
/**
* Add participants
*
* @param \AppBundle\Entity\Participants $participants
* @return Accreditation
*/
public function addParticipant(\AppBundle\Entity\Participants $participants)
{
$this->participants[] = $participants;
return $this;
}
/**
* Remove participants
*
* @param \AppBundle\Entity\Participants $participants
*/
public function removeParticipant(\AppBundle\Entity\Participants $participants)
{
$this->participants->removeElement($participants);
} |
c'est essayer plusieur chose passé un array de 'Participants' mais sa dit qui intense pas 'Participants'
bref merci de votre aide
Partager