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 configureOptions(OptionsResolver $resolver) |
||
109 | |||
110 | /** |
||
111 | * @inheritdoc |
||
112 | */ |
||
113 | public function apply($object) |
||
117 | |||
118 | /** |
||
119 | * {@inheritdoc} |
||
120 | */ |
||
121 | public function setDataGridFactory(DataGridFactoryInterface $factory) |
||
125 | |||
126 | /** |
||
127 | * {@inheritdoc} |
||
128 | */ |
||
129 | public function setDataSourceFactory(DataSourceFactoryInterface $factory) |
||
133 | |||
134 | /** |
||
135 | * {@inheritdoc} |
||
136 | */ |
||
137 | public function setFormFactory(FormFactoryInterface $factory) |
||
141 | |||
142 | /** |
||
143 | * {@inheritdoc} |
||
144 | */ |
||
145 | public function createDataGrid() |
||
170 | |||
171 | /** |
||
172 | * {@inheritdoc} |
||
173 | */ |
||
174 | public function createDataSource() |
||
184 | |||
185 | /** |
||
186 | * {@inheritdoc} |
||
187 | */ |
||
188 | public function createForm($data = null) |
||
198 | |||
199 | /** |
||
200 | * Initialize DataGrid. |
||
201 | * |
||
202 | * @param \FSi\Component\DataGrid\DataGridFactoryInterface $factory |
||
203 | * @return \FSi\Component\DataGrid\DataGridInterface |
||
204 | */ |
||
205 | abstract protected function initDataGrid(DataGridFactoryInterface $factory); |
||
206 | |||
207 | /** |
||
208 | * Initialize DataSource. |
||
209 | * |
||
210 | * @param \FSi\Component\DataSource\DataSourceFactoryInterface $factory |
||
211 | * @return \FSi\Component\DataSource\DataSourceInterface |
||
212 | */ |
||
213 | abstract protected function initDataSource(DataSourceFactoryInterface $factory); |
||
214 | |||
215 | /** |
||
216 | * Initialize create Form. This form will be used in createAction in CRUDController. |
||
217 | * |
||
218 | * @param \Symfony\Component\Form\FormFactoryInterface $factory |
||
219 | * @param mixed $data |
||
220 | * @return \Symfony\Component\Form\FormInterface |
||
221 | */ |
||
222 | abstract protected function initForm(FormFactoryInterface $factory, $data = null); |
||
223 | } |
||
224 |