Strategy.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. * Materialized Path strategy
  15. */
  16. const MATERIALIZED_PATH = 'materializedPath';
  17. /**
  18. * Get the name of strategy
  19. *
  20. * @return string
  21. */
  22. function getName();
  23. /**
  24. * Initialize strategy with tree listener
  25. *
  26. * @param TreeListener $listener
  27. * @return void
  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. * @return void
  43. */
  44. function processScheduledInsertion($om, $object);
  45. /**
  46. * Operations on tree node updates
  47. *
  48. * @param object $om - object manager
  49. * @param object $object - node
  50. * @param object $ea - event adapter
  51. * @return void
  52. */
  53. function processScheduledUpdate($om, $object, $ea);
  54. /**
  55. * Operations on tree node delete
  56. *
  57. * @param object $om - object manager
  58. * @param object $object - node
  59. * @return void
  60. */
  61. function processScheduledDelete($om, $object);
  62. /**
  63. * Operations on tree node removal
  64. *
  65. * @param object $om - object manager
  66. * @param object $object - node
  67. * @return void
  68. */
  69. function processPreRemove($om, $object);
  70. /**
  71. * Operations on tree node persist
  72. *
  73. * @param object $om - object manager
  74. * @param object $object - node
  75. * @return void
  76. */
  77. function processPrePersist($om, $object);
  78. /**
  79. * Operations on tree node insertions
  80. *
  81. * @param object $om - object manager
  82. * @param object $object - node
  83. * @param object $ea - event adapter
  84. * @return void
  85. */
  86. function processPostPersist($om, $object, $ea);
  87. /**
  88. * Operations on the end of flush process
  89. *
  90. * @param object $om - object manager
  91. * @return void
  92. */
  93. function onFlushEnd($om);
  94. }