Article.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. namespace Sluggable\Fixture\Issue449;
  3. use Gedmo\Sluggable\Sluggable;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\Entity
  8. * @Gedmo\SoftDeleteable(fieldName="deletedAt")
  9. */
  10. class Article implements Sluggable
  11. {
  12. /** @ORM\Id @ORM\GeneratedValue @ORM\Column(type="integer") */
  13. private $id;
  14. /**
  15. * @ORM\Column(name="title", type="string", length=64)
  16. */
  17. private $title;
  18. /**
  19. * @ORM\Column(name="code", type="string", length=16)
  20. */
  21. private $code;
  22. /**
  23. * @Gedmo\Slug(separator="-", updatable=true, fields={"title", "code"})
  24. * @ORM\Column(name="slug", type="string", length=64, unique=true)
  25. */
  26. private $slug;
  27. /**
  28. * @ORM\Column(name="deletedAt", type="datetime", nullable=true)
  29. */
  30. private $deletedAt;
  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 setCode($code)
  44. {
  45. $this->code = $code;
  46. }
  47. public function getCode()
  48. {
  49. return $this->code;
  50. }
  51. public function setSlug($slug)
  52. {
  53. $this->slug = $slug;
  54. }
  55. public function getSlug()
  56. {
  57. return $this->slug;
  58. }
  59. public function setDeletedAt($deletedAt)
  60. {
  61. $this->deletedAt = $deletedAt;
  62. }
  63. public function getDeletedAt()
  64. {
  65. return $this->deletedAt;
  66. }
  67. }