Article.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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(handlers={
  22. * @Gedmo\SlugHandler(class="Gedmo\Sluggable\Handler\InversedRelativeSlugHandler", options={
  23. * @Gedmo\SlugHandlerOption(name="relationClass", value="Sluggable\Fixture\Document\RelativeSlug"),
  24. * @Gedmo\SlugHandlerOption(name="mappedBy", value="article"),
  25. * @Gedmo\SlugHandlerOption(name="inverseSlugField", value="alias")
  26. * })
  27. * }, separator="-", updatable=true, fields={"title", "code"})
  28. * @ODM\String
  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 setCode($code)
  44. {
  45. $this->code = $code;
  46. }
  47. public function getCode()
  48. {
  49. return $this->code;
  50. }
  51. public function getSlug()
  52. {
  53. return $this->slug;
  54. }
  55. }