Sluggable.php 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. * @package Gedmo.Sluggable
  10. * @subpackage Sluggable
  11. * @link http://www.gediminasm.org
  12. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  13. */
  14. interface Sluggable
  15. {
  16. // use now annotations instead of predifined methods, this interface is not necessary
  17. /**
  18. * @gedmo:Sluggable
  19. * to mark the field as sluggable use property annotation @gedmo:Sluggable
  20. * this field value will be included in built slug
  21. */
  22. /**
  23. * @gedmo:Slug - to mark property which will hold slug use annotation @gedmo:Slug
  24. * available options:
  25. * updatable (optional, default=true) - true to update the slug on sluggable field changes, false - otherwise
  26. * unique (optional, default=true) - true if slug should be unique and if identical it will be prefixed, false - otherwise
  27. * separator (optional, default="-") - separator which will separate words in slug
  28. * style (optional, default="default") - "default" all letters will be lowercase, "camel" - first word letter will be uppercase
  29. *
  30. * example:
  31. *
  32. * @gedmo:Slug(style="camel", separator="_", updatable=false, unique=false)
  33. * @Column(type="string", length=64)
  34. * $property
  35. */
  36. }