forked from sonata-project/SonataAdminBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdminExtensionInterface.php
197 lines (172 loc) · 5.35 KB
/
AdminExtensionInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<?php
/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\AdminBundle\Admin;
use Knp\Menu\ItemInterface as MenuItemInterface;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\AdminBundle\Show\ShowMapper;
use Sonata\CoreBundle\Validator\ErrorElement;
/**
* Interface AdminExtensionInterface.
*
* @author Thomas Rabaix <[email protected]>
*/
interface AdminExtensionInterface
{
/**
* @param FormMapper $formMapper
*/
public function configureFormFields(FormMapper $formMapper);
/**
* @param ListMapper $listMapper
*/
public function configureListFields(ListMapper $listMapper);
/**
* @param DatagridMapper $datagridMapper
*/
public function configureDatagridFilters(DatagridMapper $datagridMapper);
/**
* @param ShowMapper $showMapper
*/
public function configureShowFields(ShowMapper $showMapper);
/**
* @param AdminInterface $admin
* @param RouteCollection $collection
*/
public function configureRoutes(AdminInterface $admin, RouteCollection $collection);
/**
* DEPRECATED: Use configureTabMenu instead.
*
* @param AdminInterface $admin
* @param MenuItemInterface $menu
* @param string $action
* @param AdminInterface $childAdmin
*
* @deprecated
*/
public function configureSideMenu(AdminInterface $admin, MenuItemInterface $menu, $action, AdminInterface $childAdmin = null);
/**
* Builds the tab menu.
*
* @param AdminInterface $admin
* @param MenuItemInterface $menu
* @param string $action
* @param AdminInterface $childAdmin
*/
public function configureTabMenu(AdminInterface $admin, MenuItemInterface $menu, $action, AdminInterface $childAdmin = null);
/**
* @param AdminInterface $admin
* @param ErrorElement $errorElement
* @param mixed $object
*/
public function validate(AdminInterface $admin, ErrorElement $errorElement, $object);
/**
* @param AdminInterface $admin
* @param ProxyQueryInterface $query
* @param string $context
*/
public function configureQuery(AdminInterface $admin, ProxyQueryInterface $query, $context = 'list');
/**
* Get a chance to modify a newly created instance.
*
* @param AdminInterface $admin
* @param mixed $object
*/
public function alterNewInstance(AdminInterface $admin, $object);
/**
* Get a chance to modify object instance.
*
* @param AdminInterface $admin
* @param mixed $object
*/
public function alterObject(AdminInterface $admin, $object);
/**
* Get a chance to add persistent parameters.
*
* @param AdminInterface $admin
*
* @return array
*/
public function getPersistentParameters(AdminInterface $admin);
/**
* Return the controller access mapping.
*
* @param AdminInterface $admin
*
* @return array
*/
// TODO: Uncomment in next major release
// public function getAccessMapping(AdminInterface $admin);
/**
* Returns the list of batch actions.
*
* @param AdminInterface $admin
* @param array $actions
*
* @return array
*/
// TODO: Uncomment in next major release
// public function configureBatchActions(AdminInterface $admin, array $actions);
/**
* Get a chance to modify export fields.
*
* @param AdminInterface $admin
* @param string[] $fields
*
* @return string[]
*/
// TODO: Uncomment in next major release
// public function configureExportFields(AdminInterface $admin, array $fields);
/**
* @param AdminInterface $admin
* @param mixed $object
*/
public function preUpdate(AdminInterface $admin, $object);
/**
* @param AdminInterface $admin
* @param mixed $object
*/
public function postUpdate(AdminInterface $admin, $object);
/**
* @param AdminInterface $admin
* @param mixed $object
*/
public function prePersist(AdminInterface $admin, $object);
/**
* @param AdminInterface $admin
* @param mixed $object
*/
public function postPersist(AdminInterface $admin, $object);
/**
* @param AdminInterface $admin
* @param mixed $object
*/
public function preRemove(AdminInterface $admin, $object);
/**
* @param AdminInterface $admin
* @param mixed $object
*/
public function postRemove(AdminInterface $admin, $object);
/*
* Get all action buttons for an action
*
* @param AdminInterface $admin
* @param array $list
* @param string $action
* @param mixed $object
*
* @return array
*/
// TODO: Uncomment in next major release
// public function configureActionButtons(AdminInterface $admin, $list, $action, $object);
}