1 | <?php |
||
22 | abstract class AbstractFormAction extends AbstractViewableAction |
||
23 | { |
||
24 | /** |
||
25 | * @var FormFactoryInterface |
||
26 | */ |
||
27 | protected $formFactory; |
||
28 | |||
29 | /** |
||
30 | * @param ActionFactory $actionFactory |
||
31 | * @param ActionEventManager $eventManager |
||
32 | * @param ManagerRegistry $managerRegistry |
||
33 | * @param RouterInterface $router |
||
34 | * @param TranslatorInterface $translator |
||
35 | * @param EngineInterface $templating |
||
36 | * @param FormFactoryInterface $formFactory |
||
37 | */ |
||
38 | public function __construct( |
||
51 | |||
52 | /** |
||
53 | * {@inheritdoc} |
||
54 | */ |
||
55 | protected function setDefaultOptions(OptionsResolver $resolver) |
||
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | public function doExecute(Request $request) |
||
93 | |||
94 | /** |
||
95 | * Saves the object |
||
96 | * |
||
97 | * @param Request $request |
||
98 | * @param FormInterface $form |
||
99 | */ |
||
100 | protected function saveForm(Request $request, FormInterface $form) |
||
104 | |||
105 | /** |
||
106 | * Gets the variables that should be present on the template |
||
107 | * |
||
108 | * @param Request $request |
||
109 | * @param Form $form |
||
110 | */ |
||
111 | protected function getTemplateVars(Request $request, FormInterface $form) |
||
118 | |||
119 | /** |
||
120 | * Returns the redirect response in case of success |
||
121 | * |
||
122 | * @param object $object |
||
123 | * |
||
124 | * @return RedirectResponse |
||
125 | */ |
||
126 | protected function getRedirectResponse($object) |
||
130 | |||
131 | /** |
||
132 | * Returns the path to be redirected to in case of success |
||
133 | * |
||
134 | * @param object $object |
||
135 | * |
||
136 | * @return string |
||
137 | */ |
||
138 | protected function getRedirectPath($object) |
||
145 | |||
146 | /** |
||
147 | * Creates the form |
||
148 | * |
||
149 | * @param Request $request |
||
150 | * @param object $object |
||
151 | * |
||
152 | * @return Form |
||
153 | */ |
||
154 | protected function createForm(Request $request, $object) |
||
162 | |||
163 | /** |
||
164 | * Returns the options of the form |
||
165 | * |
||
166 | * @param Request $request |
||
167 | * @param object $object |
||
168 | * |
||
169 | * @return array |
||
170 | */ |
||
171 | protected function getFormOptions(Request $request, $object) |
||
175 | |||
176 | /** |
||
177 | * Returns the object to use in the form |
||
178 | * |
||
179 | * @param Request $request |
||
180 | * |
||
181 | * @return object |
||
182 | */ |
||
183 | abstract protected function getObject(Request $request); |
||
184 | } |
||
185 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.