Article.php 1.0 KB

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