1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* This file is part of the Sonata Project package. |
7
|
|
|
* |
8
|
|
|
* (c) Thomas Rabaix <[email protected]> |
9
|
|
|
* |
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
11
|
|
|
* file that was distributed with this source code. |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace Sonata\AdminBundle\Admin; |
15
|
|
|
|
16
|
|
|
use Knp\Menu\ItemInterface as MenuItemInterface; |
17
|
|
|
use Sonata\AdminBundle\Datagrid\DatagridMapper; |
18
|
|
|
use Sonata\AdminBundle\Datagrid\ListMapper; |
19
|
|
|
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface; |
20
|
|
|
use Sonata\AdminBundle\Form\FormMapper; |
21
|
|
|
use Sonata\AdminBundle\Route\RouteCollection; |
22
|
|
|
use Sonata\AdminBundle\Show\ShowMapper; |
23
|
|
|
use Sonata\Form\Validator\ErrorElement; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @author Thomas Rabaix <[email protected]> |
27
|
|
|
*/ |
28
|
|
|
abstract class AbstractAdminExtension implements AdminExtensionInterface |
29
|
|
|
{ |
30
|
|
|
public function configureFormFields(FormMapper $formMapper) |
31
|
|
|
{ |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
public function configureListFields(ListMapper $listMapper) |
35
|
|
|
{ |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
public function configureDatagridFilters(DatagridMapper $datagridMapper) |
39
|
|
|
{ |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
public function configureShowFields(ShowMapper $showMapper) |
43
|
|
|
{ |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
public function configureRoutes(AdminInterface $admin, RouteCollection $collection) |
47
|
|
|
{ |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public function configureSideMenu(AdminInterface $admin, MenuItemInterface $menu, $action, ?AdminInterface $childAdmin = null) |
51
|
|
|
{ |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function configureTabMenu(AdminInterface $admin, MenuItemInterface $menu, $action, ?AdminInterface $childAdmin = null) |
55
|
|
|
{ |
56
|
|
|
// Use configureSideMenu not to mess with previous overrides |
57
|
|
|
// NEXT_MAJOR: remove this line |
58
|
|
|
$this->configureSideMenu($admin, $menu, $action, $childAdmin); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
public function validate(AdminInterface $admin, ErrorElement $errorElement, $object) |
62
|
|
|
{ |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
public function configureQuery(AdminInterface $admin, ProxyQueryInterface $query, $context = 'list') |
66
|
|
|
{ |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
public function alterNewInstance(AdminInterface $admin, $object) |
70
|
|
|
{ |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
public function alterObject(AdminInterface $admin, $object) |
74
|
|
|
{ |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
public function getPersistentParameters(AdminInterface $admin) |
78
|
|
|
{ |
79
|
|
|
return []; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
public function getAccessMapping(AdminInterface $admin) |
|
|
|
|
83
|
|
|
{ |
84
|
|
|
return []; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
public function configureBatchActions(AdminInterface $admin, array $actions) |
|
|
|
|
88
|
|
|
{ |
89
|
|
|
return $actions; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
public function configureExportFields(AdminInterface $admin, array $fields) |
|
|
|
|
93
|
|
|
{ |
94
|
|
|
return $fields; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
public function preUpdate(AdminInterface $admin, $object) |
98
|
|
|
{ |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
public function postUpdate(AdminInterface $admin, $object) |
102
|
|
|
{ |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
public function prePersist(AdminInterface $admin, $object) |
106
|
|
|
{ |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
public function postPersist(AdminInterface $admin, $object) |
110
|
|
|
{ |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
public function preRemove(AdminInterface $admin, $object) |
114
|
|
|
{ |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
public function postRemove(AdminInterface $admin, $object) |
118
|
|
|
{ |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
/** |
122
|
|
|
* @param array $list |
123
|
|
|
* @param string $action |
124
|
|
|
* @param object $object |
125
|
|
|
* |
126
|
|
|
* @return array |
127
|
|
|
*/ |
128
|
|
|
public function configureActionButtons(AdminInterface $admin, $list, $action, $object) |
|
|
|
|
129
|
|
|
{ |
130
|
|
|
return $list; |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
public function configureDefaultFilterValues(AdminInterface $admin, array &$filterValues) |
|
|
|
|
134
|
|
|
{ |
135
|
|
|
} |
136
|
|
|
|
137
|
|
|
public function configureDefaultSortValues(AdminInterface $admin, array &$sortValues): void |
|
|
|
|
138
|
|
|
{ |
139
|
|
|
} |
140
|
|
|
} |
141
|
|
|
|
142
|
|
|
class_exists(\Sonata\Form\Validator\ErrorElement::class); |
143
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.