Vehicle.php 940 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace Sluggable\Fixture\Inheritance;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. /**
  6. * @ORM\Entity
  7. * @ORM\InheritanceType("SINGLE_TABLE")
  8. * @ORM\DiscriminatorColumn(name="discriminator", type="string")
  9. * @ORM\DiscriminatorMap({
  10. * "vehicle" = "Vehicle",
  11. * "car" = "Car"
  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\Column(length=128)
  24. */
  25. private $title;
  26. /**
  27. * @Gedmo\Slug(fields={"title"})
  28. * @ORM\Column(length=128, unique=true)
  29. */
  30. private $slug;
  31. public function getId()
  32. {
  33. return $this->id;
  34. }
  35. public function setTitle($title)
  36. {
  37. $this->title = $title;
  38. }
  39. public function getTitle()
  40. {
  41. return $this->title;
  42. }
  43. public function getSlug()
  44. {
  45. return $this->slug;
  46. }
  47. }