AdminExtension.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <?php
  2. /*
  3. * This file is part of the Sonata 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. use Sonata\AdminBundle\Form\FormMapper;
  12. use Sonata\AdminBundle\Datagrid\ListMapper;
  13. use Sonata\AdminBundle\Datagrid\DatagridMapper;
  14. use Sonata\AdminBundle\Show\ShowMapper;
  15. use Sonata\AdminBundle\Route\RouteCollection;
  16. use Sonata\CoreBundle\Validator\ErrorElement;
  17. use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;
  18. use Knp\Menu\ItemInterface as MenuItemInterface;
  19. abstract class AdminExtension implements AdminExtensionInterface
  20. {
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function configureFormFields(FormMapper $form)
  25. {}
  26. /**
  27. * {@inheritdoc}
  28. */
  29. public function configureListFields(ListMapper $list)
  30. {}
  31. /**
  32. * {@inheritdoc}
  33. */
  34. public function configureDatagridFilters(DatagridMapper $filter)
  35. {}
  36. /**
  37. * {@inheritdoc}
  38. */
  39. public function configureShowFields(ShowMapper $show)
  40. {}
  41. /**
  42. * {@inheritdoc}
  43. */
  44. public function configureRoutes(AdminInterface $admin, RouteCollection $collection)
  45. {}
  46. /**
  47. * {@inheritdoc}
  48. */
  49. public function configureSideMenu(AdminInterface $admin, MenuItemInterface $menu, $action, AdminInterface $childAdmin = null)
  50. {}
  51. /**
  52. * {@inheritdoc}
  53. */
  54. public function configureTabMenu(AdminInterface $admin, MenuItemInterface $menu, $action, AdminInterface $childAdmin = null)
  55. {
  56. // Use configureSideMenu not to mess with previous overrides
  57. // TODO remove once deprecation period is over
  58. $this->configureSideMenu($admin, $menu, $action, $childAdmin);
  59. }
  60. /**
  61. * {@inheritdoc}
  62. */
  63. public function validate(AdminInterface $admin, ErrorElement $errorElement, $object)
  64. {}
  65. /**
  66. * {@inheritdoc}
  67. */
  68. public function configureQuery(AdminInterface $admin, ProxyQueryInterface $query, $context = 'list')
  69. {}
  70. /**
  71. * {@inheritdoc}
  72. */
  73. public function alterNewInstance(AdminInterface $admin, $object)
  74. {}
  75. /**
  76. * {@inheritdoc}
  77. */
  78. public function alterObject(AdminInterface $admin, $object)
  79. {}
  80. /**
  81. * {@inheritdoc}
  82. */
  83. public function getPersistentParameters(AdminInterface $admin)
  84. {
  85. return array();
  86. }
  87. /**
  88. * {@inheritdoc}
  89. */
  90. public function preUpdate(AdminInterface $admin, $object)
  91. {}
  92. /**
  93. * {@inheritdoc}
  94. */
  95. public function postUpdate(AdminInterface $admin, $object)
  96. {}
  97. /**
  98. * {@inheritdoc}
  99. */
  100. public function prePersist(AdminInterface $admin, $object)
  101. {}
  102. /**
  103. * {@inheritdoc}
  104. */
  105. public function postPersist(AdminInterface $admin, $object)
  106. {}
  107. /**
  108. * {@inheritdoc}
  109. */
  110. public function preRemove(AdminInterface $admin, $object)
  111. {}
  112. /**
  113. * {@inheritdoc}
  114. */
  115. public function postRemove(AdminInterface $admin, $object)
  116. {}
  117. }