Vehicle.php 978 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace Tree\Fixture\Transport;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * @ORM\Entity
  6. * @ORM\InheritanceType("SINGLE_TABLE")
  7. * @ORM\DiscriminatorColumn(name="discriminator", type="string")
  8. * @ORM\DiscriminatorMap({
  9. * "vehicle" = "Vehicle",
  10. * "car" = "Car",
  11. * "bus" = "Bus"
  12. * })
  13. */
  14. class Vehicle
  15. {
  16. /**
  17. * @ORM\Id
  18. * @ORM\GeneratedValue
  19. * @ORM\Column(type="integer")
  20. */
  21. private $id;
  22. /**
  23. * @ORM\OneToOne(targetEntity="Engine")
  24. */
  25. private $engine;
  26. /**
  27. * @ORM\Column(length=128)
  28. */
  29. private $title;
  30. public function getId()
  31. {
  32. return $this->id;
  33. }
  34. public function setEngine(Engine $engine)
  35. {
  36. $this->engine = $engine;
  37. }
  38. public function getEngine()
  39. {
  40. return $this->engine;
  41. }
  42. public function setTitle($title)
  43. {
  44. $this->title = $title;
  45. }
  46. public function getTitle()
  47. {
  48. return $this->title;
  49. }
  50. }