SluggableAdapter.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace Gedmo\Sluggable\Mapping\Event;
  3. use Gedmo\Mapping\Event\AdapterInterface;
  4. /**
  5. * Doctrine event adapter interface
  6. * for Sluggable behavior
  7. *
  8. * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
  9. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  10. */
  11. interface SluggableAdapter extends AdapterInterface
  12. {
  13. /**
  14. * Loads the similar slugs
  15. *
  16. * @param object $object
  17. * @param object $meta
  18. * @param array $config
  19. * @param string $slug
  20. * @return array
  21. */
  22. function getSimilarSlugs($object, $meta, array $config, $slug);
  23. /**
  24. * Replace part of slug to all objects
  25. * matching $target pattern
  26. *
  27. * @param object $object
  28. * @param array $config
  29. * @param string $target
  30. * @param string $replacement
  31. * @return integer
  32. */
  33. function replaceRelative($object, array $config, $target, $replacement);
  34. /**
  35. * Replace part of slug to all objects
  36. * matching $target pattern and having $object
  37. * related
  38. *
  39. * @param object $object
  40. * @param array $config
  41. * @param string $target
  42. * @param string $replacement
  43. * @return integer
  44. */
  45. function replaceInverseRelative($object, array $config, $target, $replacement);
  46. }