Strategy.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. namespace Gedmo\Tree;
  3. interface Strategy
  4. {
  5. /**
  6. * NestedSet strategy
  7. */
  8. const NESTED = 'nested';
  9. /**
  10. * Closure strategy
  11. */
  12. const CLOSURE = 'closure';
  13. /**
  14. * Get the name of strategy
  15. *
  16. * @return string
  17. */
  18. function getName();
  19. /**
  20. * Initialize strategy with tree listener
  21. *
  22. * @param TreeListener $listener
  23. * @return void
  24. */
  25. function __construct(TreeListener $listener);
  26. /**
  27. * Operations on tree node insertion
  28. *
  29. * @param object $om - object manager
  30. * @param object $object - node
  31. * @return void
  32. */
  33. function processScheduledInsertion($om, $object);
  34. /**
  35. * Operations on tree node updates
  36. *
  37. * @param object $om - object manager
  38. * @param object $object - node
  39. * @return void
  40. */
  41. function processScheduledUpdate($om, $object);
  42. /**
  43. * Operations on tree node removal
  44. *
  45. * @param object $om - object manager
  46. * @param object $object - node
  47. * @return void
  48. */
  49. function processPreRemove($om, $object);
  50. /**
  51. * Operations on tree node persist
  52. *
  53. * @param object $om - object manager
  54. * @param object $object - node
  55. * @return void
  56. */
  57. function processPrePersist($om, $object);
  58. /**
  59. * Operations on tree node insertions
  60. *
  61. * @param object $om - object manager
  62. * @param object $object - node
  63. * @return void
  64. */
  65. function processPostPersist($om, $object);
  66. /**
  67. * Operations on the end of flush process
  68. *
  69. * @param object $om - object manager
  70. * @return void
  71. */
  72. function onFlushEnd($om);
  73. }