1 | <?php |
||
23 | abstract class GenericCRUDElement extends AbstractElement implements CRUDElement |
||
24 | { |
||
25 | /** |
||
26 | * @var \FSi\Component\DataSource\DataSourceFactoryInterface |
||
27 | */ |
||
28 | protected $datasourceFactory; |
||
29 | |||
30 | /** |
||
31 | * @var \FSi\Component\DataGrid\DataGridFactoryInterface |
||
32 | */ |
||
33 | protected $datagridFactory; |
||
34 | |||
35 | /** |
||
36 | * @var \Symfony\Component\Form\FormFactoryInterface |
||
37 | */ |
||
38 | protected $formFactory; |
||
39 | |||
40 | /** |
||
41 | * {@inheritdoc} |
||
42 | */ |
||
43 | public function getRoute() |
||
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | */ |
||
51 | public function getSuccessRoute() |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | public function getSuccessRouteParameters() |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | public function setDefaultOptions(OptionsResolver $resolver) |
||
101 | |||
102 | /** |
||
103 | * @inheritdoc |
||
104 | */ |
||
105 | public function apply($object) |
||
109 | |||
110 | /** |
||
111 | * {@inheritdoc} |
||
112 | */ |
||
113 | public function setDataGridFactory(DataGridFactoryInterface $factory) |
||
117 | |||
118 | /** |
||
119 | * {@inheritdoc} |
||
120 | */ |
||
121 | public function setDataSourceFactory(DataSourceFactoryInterface $factory) |
||
125 | |||
126 | /** |
||
127 | * {@inheritdoc} |
||
128 | */ |
||
129 | public function setFormFactory(FormFactoryInterface $factory) |
||
133 | |||
134 | /** |
||
135 | * {@inheritdoc} |
||
136 | */ |
||
137 | public function createDataGrid() |
||
162 | |||
163 | /** |
||
164 | * {@inheritdoc} |
||
165 | */ |
||
166 | public function createDataSource() |
||
176 | |||
177 | /** |
||
178 | * {@inheritdoc} |
||
179 | */ |
||
180 | public function createForm($data = null) |
||
190 | |||
191 | /** |
||
192 | * Initialize DataGrid. |
||
193 | * |
||
194 | * @param \FSi\Component\DataGrid\DataGridFactoryInterface $factory |
||
195 | * @return \FSi\Component\DataGrid\DataGridInterface |
||
196 | */ |
||
197 | abstract protected function initDataGrid(DataGridFactoryInterface $factory); |
||
198 | |||
199 | /** |
||
200 | * Initialize DataSource. |
||
201 | * |
||
202 | * @param \FSi\Component\DataSource\DataSourceFactoryInterface $factory |
||
203 | * @return \FSi\Component\DataSource\DataSourceInterface |
||
204 | */ |
||
205 | abstract protected function initDataSource(DataSourceFactoryInterface $factory); |
||
206 | |||
207 | /** |
||
208 | * Initialize create Form. This form will be used in createAction in CRUDController. |
||
209 | * |
||
210 | * @param \Symfony\Component\Form\FormFactoryInterface $factory |
||
211 | * @param mixed $data |
||
212 | * @return \Symfony\Component\Form\FormInterface |
||
213 | */ |
||
214 | abstract protected function initForm(FormFactoryInterface $factory, $data = null); |
||
215 | } |
||
216 |