AbstractAdminExtension.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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. use Knp\Menu\ItemInterface as MenuItemInterface;
  12. use Sonata\AdminBundle\Datagrid\DatagridMapper;
  13. use Sonata\AdminBundle\Datagrid\ListMapper;
  14. use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;
  15. use Sonata\AdminBundle\Form\FormMapper;
  16. use Sonata\AdminBundle\Route\RouteCollection;
  17. use Sonata\AdminBundle\Show\ShowMapper;
  18. use Sonata\CoreBundle\Validator\ErrorElement;
  19. /**
  20. * @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
  21. */
  22. abstract class AbstractAdminExtension implements AdminExtensionInterface
  23. {
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public function configureFormFields(FormMapper $formMapper)
  28. {
  29. }
  30. /**
  31. * {@inheritdoc}
  32. */
  33. public function configureListFields(ListMapper $listMapper)
  34. {
  35. }
  36. /**
  37. * {@inheritdoc}
  38. */
  39. public function configureDatagridFilters(DatagridMapper $datagridMapper)
  40. {
  41. }
  42. /**
  43. * {@inheritdoc}
  44. */
  45. public function configureShowFields(ShowMapper $showMapper)
  46. {
  47. }
  48. /**
  49. * {@inheritdoc}
  50. */
  51. public function configureRoutes(AdminInterface $admin, RouteCollection $collection)
  52. {
  53. }
  54. /**
  55. * {@inheritdoc}
  56. */
  57. public function configureSideMenu(AdminInterface $admin, MenuItemInterface $menu, $action, AdminInterface $childAdmin = null)
  58. {
  59. }
  60. /**
  61. * {@inheritdoc}
  62. */
  63. public function configureTabMenu(AdminInterface $admin, MenuItemInterface $menu, $action, AdminInterface $childAdmin = null)
  64. {
  65. // Use configureSideMenu not to mess with previous overrides
  66. // TODO remove once deprecation period is over
  67. $this->configureSideMenu($admin, $menu, $action, $childAdmin);
  68. }
  69. /**
  70. * {@inheritdoc}
  71. */
  72. public function validate(AdminInterface $admin, ErrorElement $errorElement, $object)
  73. {
  74. }
  75. /**
  76. * {@inheritdoc}
  77. */
  78. public function configureQuery(AdminInterface $admin, ProxyQueryInterface $query, $context = 'list')
  79. {
  80. }
  81. /**
  82. * {@inheritdoc}
  83. */
  84. public function alterNewInstance(AdminInterface $admin, $object)
  85. {
  86. }
  87. /**
  88. * {@inheritdoc}
  89. */
  90. public function alterObject(AdminInterface $admin, $object)
  91. {
  92. }
  93. /**
  94. * {@inheritdoc}
  95. */
  96. public function getPersistentParameters(AdminInterface $admin)
  97. {
  98. return array();
  99. }
  100. /**
  101. * {@inheritdoc}
  102. */
  103. public function getAccessMapping(AdminInterface $admin)
  104. {
  105. return array();
  106. }
  107. /**
  108. * {@inheritdoc}
  109. */
  110. public function configureBatchActions(AdminInterface $admin, array $actions)
  111. {
  112. return $actions;
  113. }
  114. /**
  115. * {@inheritdoc}
  116. */
  117. public function configureExportFields(AdminInterface $admin, array $fields)
  118. {
  119. return $fields;
  120. }
  121. /**
  122. * {@inheritdoc}
  123. */
  124. public function preUpdate(AdminInterface $admin, $object)
  125. {
  126. }
  127. /**
  128. * {@inheritdoc}
  129. */
  130. public function postUpdate(AdminInterface $admin, $object)
  131. {
  132. }
  133. /**
  134. * {@inheritdoc}
  135. */
  136. public function prePersist(AdminInterface $admin, $object)
  137. {
  138. }
  139. /**
  140. * {@inheritdoc}
  141. */
  142. public function postPersist(AdminInterface $admin, $object)
  143. {
  144. }
  145. /**
  146. * {@inheritdoc}
  147. */
  148. public function preRemove(AdminInterface $admin, $object)
  149. {
  150. }
  151. /**
  152. * {@inheritdoc}
  153. */
  154. public function postRemove(AdminInterface $admin, $object)
  155. {
  156. }
  157. /**
  158. * {@inheritdoc}
  159. */
  160. public function configureActionButtons(AdminInterface $admin, $list, $action, $object)
  161. {
  162. return $list;
  163. }
  164. /**
  165. * Returns a list of default filters.
  166. *
  167. * @param AdminInterface $admin
  168. * @param array $filterValues
  169. */
  170. public function configureDefaultFilterValues(AdminInterface $admin, array &$filterValues)
  171. {
  172. }
  173. }