Strategy.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <?php
  2. namespace Gedmo\Tree;
  3. use Gedmo\Mapping\Event\AdapterInterface;
  4. interface Strategy
  5. {
  6. /**
  7. * NestedSet strategy
  8. */
  9. const NESTED = 'nested';
  10. /**
  11. * Closure strategy
  12. */
  13. const CLOSURE = 'closure';
  14. /**
  15. * Materialized Path strategy
  16. */
  17. const MATERIALIZED_PATH = 'materializedPath';
  18. /**
  19. * Get the name of strategy
  20. *
  21. * @return string
  22. */
  23. function getName();
  24. /**
  25. * Initialize strategy with tree listener
  26. *
  27. * @param TreeListener $listener
  28. */
  29. function __construct(TreeListener $listener);
  30. /**
  31. * Operations after metadata is loaded
  32. *
  33. * @param object $om
  34. * @param object $meta
  35. */
  36. function processMetadataLoad($om, $meta);
  37. /**
  38. * Operations on tree node insertion
  39. *
  40. * @param object $om - object manager
  41. * @param object $object - node
  42. * @param AdapterInterface $ea - event adapter
  43. * @return void
  44. */
  45. function processScheduledInsertion($om, $object, AdapterInterface $ea);
  46. /**
  47. * Operations on tree node updates
  48. *
  49. * @param object $om - object manager
  50. * @param object $object - node
  51. * @param AdapterInterface $ea - event adapter
  52. * @return void
  53. */
  54. function processScheduledUpdate($om, $object, AdapterInterface $ea);
  55. /**
  56. * Operations on tree node delete
  57. *
  58. * @param object $om - object manager
  59. * @param object $object - node
  60. * @return void
  61. */
  62. function processScheduledDelete($om, $object);
  63. /**
  64. * Operations on tree node removal
  65. *
  66. * @param object $om - object manager
  67. * @param object $object - node
  68. * @return void
  69. */
  70. function processPreRemove($om, $object);
  71. /**
  72. * Operations on tree node persist
  73. *
  74. * @param object $om - object manager
  75. * @param object $object - node
  76. * @return void
  77. */
  78. function processPrePersist($om, $object);
  79. /**
  80. * Operations on tree node update
  81. *
  82. * @param object $om - object manager
  83. * @param object $object - node
  84. * @return void
  85. */
  86. function processPreUpdate($om, $object);
  87. /**
  88. * Operations on tree node insertions
  89. *
  90. * @param object $om - object manager
  91. * @param object $object - node
  92. * @param AdapterInterface $ea - event adapter
  93. * @return void
  94. */
  95. function processPostPersist($om, $object, AdapterInterface $ea);
  96. /**
  97. * Operations on tree node updates
  98. *
  99. * @param object $om - object manager
  100. * @param object $object - node
  101. * @param AdapterInterface $ea - event adapter
  102. * @return void
  103. */
  104. function processPostUpdate($om, $object, AdapterInterface $ea);
  105. /**
  106. * Operations on tree node removals
  107. *
  108. * @param object $om - object manager
  109. * @param object $object - node
  110. * @param AdapterInterface $ea - event adapter
  111. * @return void
  112. */
  113. function processPostRemove($om, $object, AdapterInterface $ea);
  114. /**
  115. * Operations on the end of flush process
  116. *
  117. * @param object $om - object manager
  118. * @param AdapterInterface $ea - event adapter
  119. * @return void
  120. */
  121. function onFlushEnd($om, AdapterInterface $ea);
  122. }