Strategy.php 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. * @return void
  29. */
  30. function __construct(TreeListener $listener);
  31. /**
  32. * Operations after metadata is loaded
  33. *
  34. * @param object $om
  35. * @param object $meta
  36. */
  37. function processMetadataLoad($om, $meta);
  38. /**
  39. * Operations on tree node insertion
  40. *
  41. * @param object $om - object manager
  42. * @param object $object - node
  43. * @param AdapterInterface $ea - event adapter
  44. * @return void
  45. */
  46. function processScheduledInsertion($om, $object, AdapterInterface $ea);
  47. /**
  48. * Operations on tree node updates
  49. *
  50. * @param object $om - object manager
  51. * @param object $object - node
  52. * @param AdapterInterface $ea - event adapter
  53. * @return void
  54. */
  55. function processScheduledUpdate($om, $object, AdapterInterface $ea);
  56. /**
  57. * Operations on tree node delete
  58. *
  59. * @param object $om - object manager
  60. * @param object $object - node
  61. * @return void
  62. */
  63. function processScheduledDelete($om, $object);
  64. /**
  65. * Operations on tree node removal
  66. *
  67. * @param object $om - object manager
  68. * @param object $object - node
  69. * @return void
  70. */
  71. function processPreRemove($om, $object);
  72. /**
  73. * Operations on tree node persist
  74. *
  75. * @param object $om - object manager
  76. * @param object $object - node
  77. * @return void
  78. */
  79. function processPrePersist($om, $object);
  80. /**
  81. * Operations on tree node update
  82. *
  83. * @param object $om - object manager
  84. * @param object $object - node
  85. * @return void
  86. */
  87. function processPreUpdate($om, $object);
  88. /**
  89. * Operations on tree node insertions
  90. *
  91. * @param object $om - object manager
  92. * @param object $object - node
  93. * @param AdapterInterface $ea - event adapter
  94. * @return void
  95. */
  96. function processPostPersist($om, $object, AdapterInterface $ea);
  97. /**
  98. * Operations on tree node updates
  99. *
  100. * @param object $om - object manager
  101. * @param object $object - node
  102. * @param AdapterInterface $ea - event adapter
  103. * @return void
  104. */
  105. function processPostUpdate($om, $object, AdapterInterface $ea);
  106. /**
  107. * Operations on tree node removals
  108. *
  109. * @param object $om - object manager
  110. * @param object $object - node
  111. * @param AdapterInterface $ea - event adapter
  112. * @return void
  113. */
  114. function processPostRemove($om, $object, AdapterInterface $ea);
  115. /**
  116. * Operations on the end of flush process
  117. *
  118. * @param object $om - object manager
  119. * @param AdapterInterface $ea - event adapter
  120. * @return void
  121. */
  122. function onFlushEnd($om, AdapterInterface $ea);
  123. }