1 | <?php |
||
25 | abstract class AbstractCRUD extends AbstractElement implements CRUDElement |
||
26 | { |
||
27 | /** |
||
28 | * @var \FSi\Component\DataSource\DataSourceFactoryInterface |
||
29 | */ |
||
30 | protected $datasourceFactory; |
||
31 | |||
32 | /** |
||
33 | * @var \FSi\Component\DataGrid\DataGridFactoryInterface |
||
34 | */ |
||
35 | protected $datagridFactory; |
||
36 | |||
37 | /** |
||
38 | * @var \Symfony\Component\Form\FormFactoryInterface |
||
39 | */ |
||
40 | protected $formFactory; |
||
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | public function getRoute() |
||
49 | |||
50 | /** |
||
51 | * {@inheritdoc} |
||
52 | */ |
||
53 | public function getSuccessRoute() |
||
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | public function getSuccessRouteParameters() |
||
65 | |||
66 | /** |
||
67 | * {@inheritdoc} |
||
68 | */ |
||
69 | public function setDefaultOptions(OptionsResolver $resolver) |
||
83 | |||
84 | /** |
||
85 | * @inheritdoc |
||
86 | */ |
||
87 | public function apply($object) |
||
91 | |||
92 | /** |
||
93 | * {@inheritdoc} |
||
94 | */ |
||
95 | public function setDataGridFactory(DataGridFactoryInterface $factory) |
||
99 | |||
100 | /** |
||
101 | * {@inheritdoc} |
||
102 | */ |
||
103 | public function setDataSourceFactory(DataSourceFactoryInterface $factory) |
||
107 | |||
108 | /** |
||
109 | * {@inheritdoc} |
||
110 | */ |
||
111 | public function setFormFactory(FormFactoryInterface $factory) |
||
115 | |||
116 | /** |
||
117 | * {@inheritdoc} |
||
118 | */ |
||
119 | public function createDataGrid() |
||
144 | |||
145 | /** |
||
146 | * {@inheritdoc} |
||
147 | */ |
||
148 | public function createDataSource() |
||
158 | |||
159 | /** |
||
160 | * {@inheritdoc} |
||
161 | */ |
||
162 | public function createForm($data = null) |
||
172 | |||
173 | /** |
||
174 | * Initialize DataGrid. |
||
175 | * |
||
176 | * @param \FSi\Component\DataGrid\DataGridFactoryInterface $factory |
||
177 | * @return \FSi\Component\DataGrid\DataGridInterface |
||
178 | */ |
||
179 | abstract protected function initDataGrid(DataGridFactoryInterface $factory); |
||
180 | |||
181 | /** |
||
182 | * Initialize DataSource. |
||
183 | * |
||
184 | * @param \FSi\Component\DataSource\DataSourceFactoryInterface $factory |
||
185 | * @return \FSi\Component\DataSource\DataSourceInterface |
||
186 | */ |
||
187 | abstract protected function initDataSource(DataSourceFactoryInterface $factory); |
||
188 | |||
189 | /** |
||
190 | * Initialize create Form. This form will be used in createAction in CRUDController. |
||
191 | * |
||
192 | * @param \Symfony\Component\Form\FormFactoryInterface $factory |
||
193 | * @param mixed $data |
||
194 | * @return \Symfony\Component\Form\FormInterface |
||
195 | */ |
||
196 | abstract protected function initForm(FormFactoryInterface $factory, $data = null); |
||
197 | } |
||
198 |