Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. <?php
  2.  
  3. namespace AppBundle\Entity;
  4.  
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7.  
  8. /**
  9. * Appareil
  10. *
  11. * @ORM\Table()
  12. * @ORM\Entity
  13. */
  14. class Appareil
  15. { /**
  16. * @ORM\ManyToOne(targetEntity="Combustible" , inversedBy="Appareil")
  17. * @ORM\JoinColumn(name="combustibles",referencedColumnName="id")
  18. */
  19. private $combustibles;
  20. public function addCombustible(Combustible $combustible)
  21. {
  22. if (!$this->combustible->contains($combustible)) {
  23. $this->combustible->add($combustible);
  24. }
  25. }
  26.  
  27.  
  28. public function __toString() {
  29. return $this->name;
  30. }
  31.  
  32. /**
  33. * Set combustibles
  34. *
  35. * @param \AppBundle\Entity\Combustible $combustibles
  36. * @return Appareil
  37. */
  38. public function setCombustibles( $combustibles = null)
  39. {
  40.  
  41. $this->combustibles[] = $combustibles;
  42.  
  43. return $this;
  44. }
  45.  
  46. /**
  47. * Get combustibles
  48. *
  49. * @return \AppBundle\Entity\Combustible
  50. */
  51. public function getCombustibles()
  52. {
  53. return $this->combustibles;
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement