Sluggable.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 predefined 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. * unique_base (optional, default="") - used in conjunction with unique. The name of the entity property that should be used as a key when doing a uniqueness check
  25. * separator (optional, default="-") - separator which will separate words in slug
  26. * prefix (optional, default="") - prefix which will be added to the generated slug
  27. * suffix (optional, default="") - suffix which will be added to the generated slug
  28. * style (optional, default="default") - "default" all letters will be lowercase, "camel" - first word letter will be uppercase
  29. * dateFormat (optional, default="default") - "default" all letters will be lowercase, "camel" - first word letter will be uppercase
  30. *
  31. * example:
  32. *
  33. * @gedmo:Slug(style="camel", separator="_", prefix="", suffix="", updatable=false, unique=false)
  34. * @Column(type="string", length=64)
  35. * $property
  36. */
  37. }