Article.php 923 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace Sluggable\Fixture\Document;
  3. use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. /**
  6. * @ODM\Document(collection="articles")
  7. */
  8. class Article
  9. {
  10. /** @ODM\Id */
  11. private $id;
  12. /**
  13. * @ODM\String
  14. */
  15. private $title;
  16. /**
  17. * @ODM\String
  18. */
  19. private $code;
  20. /**
  21. * @Gedmo\Slug(separator="-", updatable=true, fields={"title", "code"})
  22. * @ODM\String
  23. */
  24. private $slug;
  25. public function getId()
  26. {
  27. return $this->id;
  28. }
  29. public function setTitle($title)
  30. {
  31. $this->title = $title;
  32. }
  33. public function getTitle()
  34. {
  35. return $this->title;
  36. }
  37. public function setCode($code)
  38. {
  39. $this->code = $code;
  40. }
  41. public function getCode()
  42. {
  43. return $this->code;
  44. }
  45. public function getSlug()
  46. {
  47. return $this->slug;
  48. }
  49. }