LifecycleHookProviderInterface.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. /*
  3. * This file is part of the Sonata Project package.
  4. *
  5. * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Sonata\AdminBundle\Admin;
  11. /**
  12. * This interface can be implemented to provide hooks that will be called
  13. * during the lifecycle of the object.
  14. *
  15. * @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
  16. */
  17. interface LifecycleHookProviderInterface
  18. {
  19. /**
  20. * @param object $object
  21. *
  22. * @return object
  23. */
  24. public function update($object);
  25. /**
  26. * @param object $object
  27. *
  28. * @return object
  29. */
  30. public function create($object);
  31. /**
  32. * @param object $object
  33. */
  34. public function delete($object);
  35. //NEXT_MAJOR: uncomment this method for 4.0
  36. // /**
  37. // * @param object $object
  38. // */
  39. // public function preValidate($object);
  40. /**
  41. * @param object $object
  42. */
  43. public function preUpdate($object);
  44. /**
  45. * @param object $object
  46. */
  47. public function postUpdate($object);
  48. /**
  49. * @param object $object
  50. */
  51. public function prePersist($object);
  52. /**
  53. * @param object $object
  54. */
  55. public function postPersist($object);
  56. /**
  57. * @param object $object
  58. */
  59. public function preRemove($object);
  60. /**
  61. * @param object $object
  62. */
  63. public function postRemove($object);
  64. }