|
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\RouteCollectionInterface; |
|
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): void |
|
31
|
|
|
{ |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
public function configureListFields(ListMapper $listMapper): void |
|
35
|
|
|
{ |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
public function configureDatagridFilters(DatagridMapper $datagridMapper): void |
|
39
|
|
|
{ |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
public function configureShowFields(ShowMapper $showMapper): void |
|
43
|
|
|
{ |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
public function configureRoutes(AdminInterface $admin, RouteCollectionInterface $collection): void |
|
47
|
|
|
{ |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
public function configureTabMenu(AdminInterface $admin, MenuItemInterface $menu, string $action, ?AdminInterface $childAdmin = null): void |
|
51
|
|
|
{ |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
public function configureQuery(AdminInterface $admin, ProxyQueryInterface $query): void |
|
55
|
|
|
{ |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
public function alterNewInstance(AdminInterface $admin, object $object): void |
|
59
|
|
|
{ |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
public function alterObject(AdminInterface $admin, object $object): void |
|
63
|
|
|
{ |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
public function getPersistentParameters(AdminInterface $admin): array |
|
67
|
|
|
{ |
|
68
|
|
|
return []; |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
public function getAccessMapping(AdminInterface $admin): array |
|
72
|
|
|
{ |
|
73
|
|
|
return []; |
|
74
|
|
|
} |
|
75
|
|
|
|
|
76
|
|
|
public function configureBatchActions(AdminInterface $admin, array $actions): array |
|
77
|
|
|
{ |
|
78
|
|
|
return $actions; |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
public function configureExportFields(AdminInterface $admin, array $fields): array |
|
82
|
|
|
{ |
|
83
|
|
|
return $fields; |
|
84
|
|
|
} |
|
85
|
|
|
|
|
86
|
|
|
public function preUpdate(AdminInterface $admin, object $object): void |
|
87
|
|
|
{ |
|
88
|
|
|
} |
|
89
|
|
|
|
|
90
|
|
|
public function postUpdate(AdminInterface $admin, object $object): void |
|
91
|
|
|
{ |
|
92
|
|
|
} |
|
93
|
|
|
|
|
94
|
|
|
public function prePersist(AdminInterface $admin, object $object): void |
|
95
|
|
|
{ |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
public function postPersist(AdminInterface $admin, object $object): void |
|
99
|
|
|
{ |
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
|
public function preRemove(AdminInterface $admin, object $object): void |
|
103
|
|
|
{ |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
public function postRemove(AdminInterface $admin, object $object): void |
|
107
|
|
|
{ |
|
108
|
|
|
} |
|
109
|
|
|
|
|
110
|
|
|
/** |
|
111
|
|
|
* @param object $object |
|
112
|
|
|
*/ |
|
113
|
|
|
public function configureActionButtons( |
|
114
|
|
|
AdminInterface $admin, |
|
115
|
|
|
array $list, |
|
116
|
|
|
string $action, |
|
117
|
|
|
?object $object = null |
|
118
|
|
|
): array { |
|
119
|
|
|
return $list; |
|
120
|
|
|
} |
|
121
|
|
|
|
|
122
|
|
|
/** |
|
123
|
|
|
* Returns a list of default filters. |
|
124
|
|
|
*/ |
|
125
|
|
|
public function configureDefaultFilterValues(AdminInterface $admin, array &$filterValues): void |
|
126
|
|
|
{ |
|
127
|
|
|
} |
|
128
|
|
|
|
|
129
|
|
|
public function configureDefaultSortValues(AdminInterface $admin, array &$sortValues): void |
|
130
|
|
|
{ |
|
131
|
|
|
} |
|
132
|
|
|
} |
|
133
|
|
|
|