Prefix.php 1011 B

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