1 | <?php |
||
20 | abstract class AbstractSyliusResource |
||
21 | { |
||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private $modelClass; |
||
26 | |||
27 | /** |
||
28 | * @var string|null |
||
29 | */ |
||
30 | private $interfaceClass; |
||
31 | |||
32 | /** |
||
33 | * @var string|null |
||
34 | */ |
||
35 | private $factoryClass; |
||
36 | |||
37 | /** |
||
38 | * @var string|null |
||
39 | */ |
||
40 | private $controllerClass; |
||
41 | |||
42 | /** |
||
43 | * @var string|null |
||
44 | */ |
||
45 | private $repositoryClass; |
||
46 | |||
47 | /** |
||
48 | * @var array |
||
49 | */ |
||
50 | private $formsClasses = []; |
||
51 | |||
52 | /** |
||
53 | * @var array |
||
54 | */ |
||
55 | private $validationGroups = []; |
||
56 | |||
57 | /** |
||
58 | * @var array |
||
59 | */ |
||
60 | private $options = []; |
||
61 | |||
62 | /** |
||
63 | * @param string|null $modelClass |
||
64 | * @param string|null $interfaceClass |
||
65 | * |
||
66 | * @throws \InvalidArgumentException If given model class does not implement given interface |
||
67 | */ |
||
68 | public function __construct($modelClass = null, $interfaceClass = null) |
||
73 | |||
74 | /** |
||
75 | * @return string |
||
76 | */ |
||
77 | public function getModelClass() |
||
81 | |||
82 | /** |
||
83 | * @return string|null |
||
84 | */ |
||
85 | public function getInterfaceClass() |
||
89 | |||
90 | /** |
||
91 | * @return string|null |
||
92 | */ |
||
93 | public function getFactoryClass() |
||
97 | |||
98 | /** |
||
99 | * @param string $factoryClass |
||
100 | * |
||
101 | * @return $this |
||
102 | */ |
||
103 | public function useFactory($factoryClass) |
||
109 | |||
110 | /** |
||
111 | * @return $this |
||
112 | */ |
||
113 | public function useDefaultFactory() |
||
119 | |||
120 | /** |
||
121 | * @return string|null |
||
122 | */ |
||
123 | public function getControllerClass() |
||
127 | |||
128 | /** |
||
129 | * @param string $controllerClass |
||
130 | * |
||
131 | * @return $this |
||
132 | */ |
||
133 | public function useController($controllerClass) |
||
139 | |||
140 | /** |
||
141 | * @return $this |
||
142 | */ |
||
143 | public function useDefaultController() |
||
149 | |||
150 | /** |
||
151 | * @return string|null |
||
152 | */ |
||
153 | public function getRepositoryClass() |
||
157 | |||
158 | /** |
||
159 | * @param string $repositoryClass |
||
160 | * |
||
161 | * @return $this |
||
162 | */ |
||
163 | public function useRepository($repositoryClass) |
||
169 | |||
170 | /** |
||
171 | * @return $this |
||
172 | */ |
||
173 | public function useDefaultRepository() |
||
178 | |||
179 | /** |
||
180 | * @return array |
||
181 | */ |
||
182 | public function getFormsClasses() |
||
186 | |||
187 | /** |
||
188 | * @return array |
||
189 | */ |
||
190 | public function getValidationGroups() |
||
194 | |||
195 | /** |
||
196 | * @param string $name |
||
197 | * @param string $formClass |
||
198 | * @param array $validationGroups |
||
199 | * |
||
200 | * @return $this |
||
201 | */ |
||
202 | public function addForm($name, $formClass, array $validationGroups = []) |
||
214 | |||
215 | /** |
||
216 | * @return array |
||
217 | */ |
||
218 | public function getOptions() |
||
222 | |||
223 | /** |
||
224 | * @param array $options |
||
225 | * |
||
226 | * @return $this |
||
227 | */ |
||
228 | public function setOptions(array $options) |
||
234 | } |
||
235 |