Sluggable.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace Gedmo\Sluggable;
  3. /**
  4. * This interface is not necessary but can be implemented for
  5. * Entities which in some cases needs to be identified as
  6. * Sluggable
  7. *
  8. * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
  9. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  10. */
  11. interface Sluggable
  12. {
  13. // use now annotations instead of predifined methods, this interface is not necessary
  14. /**
  15. * @gedmo:Sluggable
  16. * to mark the field as sluggable use property annotation @gedmo:Sluggable
  17. * this field value will be included in built slug
  18. */
  19. /**
  20. * @gedmo:Slug - to mark property which will hold slug use annotation @gedmo:Slug
  21. * available options:
  22. * updatable (optional, default=true) - true to update the slug on sluggable field changes, false - otherwise
  23. * unique (optional, default=true) - true if slug should be unique and if identical it will be prefixed, false - otherwise
  24. * separator (optional, default="-") - separator which will separate words in slug
  25. * prefix (optional, default="") - suffix which will be added to the generated slug
  26. * suffix (optional, default="") - prefix which will be added to the generated slug
  27. * style (optional, default="default") - "default" all letters will be lowercase, "camel" - first word letter will be uppercase
  28. *
  29. * example:
  30. *
  31. * @gedmo:Slug(style="camel", separator="_", prefix="", suffix="" updatable=false, unique=false)
  32. * @Column(type="string", length=64)
  33. * $property
  34. */
  35. }