SluggableAdapter.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. *
  21. * @return array
  22. */
  23. public function getSimilarSlugs($object, $meta, array $config, $slug);
  24. /**
  25. * Replace part of slug to all objects
  26. * matching $target pattern
  27. *
  28. * @param object $object
  29. * @param array $config
  30. * @param string $target
  31. * @param string $replacement
  32. *
  33. * @return integer
  34. */
  35. public function replaceRelative($object, array $config, $target, $replacement);
  36. /**
  37. * Replace part of slug to all objects
  38. * matching $target pattern and having $object
  39. * related
  40. *
  41. * @param object $object
  42. * @param array $config
  43. * @param string $target
  44. * @param string $replacement
  45. *
  46. * @return integer
  47. */
  48. public function replaceInverseRelative($object, array $config, $target, $replacement);
  49. }