Article.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace Sluggable\Fixture;
  3. use Gedmo\Sluggable\Sluggable;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\Entity
  8. */
  9. class Article implements Sluggable
  10. {
  11. /** @ORM\Id @ORM\GeneratedValue @ORM\Column(type="integer") */
  12. private $id;
  13. /**
  14. * @Gedmo\Sluggable
  15. * @ORM\Column(name="title", type="string", length=64)
  16. */
  17. private $title;
  18. /**
  19. * @Gedmo\Sluggable
  20. * @ORM\Column(name="code", type="string", length=16)
  21. */
  22. private $code;
  23. /**
  24. * @Gedmo\Slug(separator="-", updatable=true)
  25. * @ORM\Column(name="slug", type="string", length=64, unique=true)
  26. */
  27. private $slug;
  28. public function getId()
  29. {
  30. return $this->id;
  31. }
  32. public function setTitle($title)
  33. {
  34. $this->title = $title;
  35. }
  36. public function getTitle()
  37. {
  38. return $this->title;
  39. }
  40. public function setCode($code)
  41. {
  42. $this->code = $code;
  43. }
  44. public function getCode()
  45. {
  46. return $this->code;
  47. }
  48. public function getSlug()
  49. {
  50. return $this->slug;
  51. }
  52. }