merci c'est résolu Merci a toi Vallyan pour ton aide,
je poste les entités pour ceux qui qui ont le même problème :
Enseignant.php
<?php
namespace MyQL\HMBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
*
* @ORM\Entity
* @ORM\Table(name="Enseignant")
*/
class Enseignant {
/**
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
*/
protected $idEns;
/**
*
* @ORM\Column(type="string", length=30)
*/
protected $nomEns;
/**
*
* @ORM\Column(type="string", length=30)
*/
protected $prenomEns;
/**
*
* @ORM\Column(type="string", length=200)
*/
protected $adresseEns;
/**
*
* @ORM\Column(type="string", length=12)
*/
protected $telENs;
/**
* @ORM\ManyToOne(targetEntity="MyQL\HMBundle\Entity\Departement")
* @ORM\JoinColumn(name="Departement", referencedColumnName="idDep")
*/
protected $departement;
/**
* @ORM\ManyToMany(targetEntity="MyQL\HMBundle\Entity\Etudiant")
* @ORM\JoinTable(name="Enseigne",
* joinColumns={@ORM\JoinColumn(name="Enseignant", referencedColumnName="idEns")},
* inverseJoinColumns={@ORM\JoinColumn(name="Etudiant", referencedColumnName="cne")}
* )
*/
protected $etudiant;
public function __construct()
{
$this->etudiant = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get idEns
*
* @return integer
*/
public function getIdEns()
{
return $this->idEns;
}
/**
* Set nomEns
*
* @param String $nomEns
*/
public function setNomEns(\String $nomEns)
{
$this->nomEns = $nomEns;
}
/**
* Get nomEns
*
* @return String
*/
public function getNomEns()
{
return $this->nomEns;
}
/**
* Set prenomEns
*
* @param String $prenomEns
*/
public function setPrenomEns(\String $prenomEns)
{
$this->prenomEns = $prenomEns;
}
/**
* Get prenomEns
*
* @return String
*/
public function getPrenomEns()
{
return $this->prenomEns;
}
/**
* Set adresseEns
*
* @param String $adresseEns
*/
public function setAdresseEns(\String $adresseEns)
{
$this->adresseEns = $adresseEns;
}
/**
* Get adresseEns
*
* @return String
*/
public function getAdresseEns()
{
return $this->adresseEns;
}
/**
* Set telENs
*
* @param String $telENs
*/
public function setTelENs(\String $telENs)
{
$this->telENs = $telENs;
}
/**
* Get telENs
*
* @return String
*/
public function getTelENs()
{
return $this->telENs;
}
/**
* Set departement
*
* @param MyQL\HMBundle\Entity\Departement $departement
*/
public function setDepartement(\MyQL\HMBundle\Entity\Departement $departement)
{
$this->departement = $departement;
}
/**
* Get departement
*
* @return MyQL\HMBundle\Entity\Departement
*/
public function getDepartement()
{
return $this->departement;
}
/**
* Add etudiant
*
* @param MyQL\HMBundle\Entity\Etudiant $etudiant
*/
public function addEtudiant(\MyQL\HMBundle\Entity\Etudiant $etudiant)
{
$this->etudiant] = $etudiant;
}
/**
* Get etudiant
*
* @return Doctrine\Common\Collections\Collection
*/
public function getEtudiant()
{
return $this->etudiant;
}
}
Etudiant.php
<?php
namespace MyQL\HMBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
*
* @ORM\Entity
* @ORM\Table(name="Etudiant")
*
*/
class Etudiant {
/**
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
*/
protected $cne;
/**
*
* @ORM\Column(type="string", length=50)
*/
protected $nomEtud;
/**
*
* @ORM\Column(type="string", length=50)
*/
protected $prenomEtud;
/**
*
* @ORM\Column(type="string", length=200)
*/
protected $adresseEtud;
/**
* Get cne
*
* @return integer
*/
public function getCne()
{
return $this->cne;
}
/**
* Set nomEtud
*
* @param string $nomEtud
*/
public function setNomEtud($nomEtud)
{
$this->nomEtud = $nomEtud;
}
/**
* Get nomEtud
*
* @return string
*/
public function getNomEtud()
{
return $this->nomEtud;
}
/**
* Set prenomEtud
*
* @param string $prenomEtud
*/
public function setPrenomEtud($prenomEtud)
{
$this->prenomEtud = $prenomEtud;
}
/**
* Get prenomEtud
*
* @return string
*/
public function getPrenomEtud()
{
return $this->prenomEtud;
}
/**
* Set adresseEtud
*
* @param string $adresseEtud
*/
public function setAdresseEtud($adresseEtud)
{
$this->adresseEtud = $adresseEtud;
}
/**
* Get adresseEtud
*
* @return string
*/
public function getAdresseEtud()
{
return $this->adresseEtud;
}
}
Departement.php
<?php
namespace MyQL\HMBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
*
* @ORM\Entity
* @ORM\Table(name="Departement")
*/
class Departement {
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
*/
protected $idDep;
/**
*
* @ORM\Column(type="string", length=30)
*/
protected $nomDep;
/**
* @ORM\OneToOne(targetEntity="MyQL\HMBundle\Entity\ChefDept")
* @ORM\JoinColumn(name="chefDept", referencedColumnName="idChef")
*/
protected $idChef;
/**
* Get idDep
*
* @return integer
*/
public function getIdDep()
{
return $this->idDep;
}
/**
* Set nomDep
*
* @param String $nomDep
*/
public function setNomDep(\String $nomDep)
{
$this->nomDep = $nomDep;
}
/**
* Get nomDep
*
* @return String
*/
public function getNomDep()
{
return $this->nomDep;
}
/**
* Set chefDept
*
* @param MyQL\HMBundle\Entity\ChefDept $chefDept
*/
public function setChefDept(\MyQL\HMBundle\Entity\ChefDept $chefDept)
{
$this->chefDept = $chefDept;
}
/**
* Get chefDept
*
* @return MyQL\HMBundle\Entity\ChefDept
*/
public function getChefDept()
{
return $this->chefDept;
}
}
ChefDept.php
<?php
namespace MyQL\HMBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
*
* @ORM\Entity
* @ORM\Table(name="chefDept")
*/
class ChefDept {
/**
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
*/
protected $idChef;
/**
*
* @ORM\Column(type="string", length=30)
*/
protected $nomChef;
/**
* Get idChef
*
* @return integer
*/
public function getIdChef()
{
return $this->idChef;
}
/**
* Set nomChef
*
* @param String $nomChef
*/
public function setNomChef(\String $nomChef)
{
$this->nomChef = $nomChef;
}
/**
* Get nomChef
*
* @return String
*/
public function getNomChef()
{
return $this->nomChef;
}
}