@@ -72,7 +72,7 @@ public static function getSubscribedServices(): array
7272 */
7373 public function initializeAction (Request $ request , EventDispatcherInterface $ eventDispatcher )
7474 {
75- $ objectId = $ request ->get ('id ' );
75+ $ objectId = $ request ->query -> getInt ('id ' );
7676 $ object = AbstractObject::getById ($ objectId );
7777
7878 if (!$ object ) {
@@ -104,7 +104,7 @@ public function getOutputConfigsAction(Request $request)
104104 Service::initChannelsForRootobject ();
105105 $ channels = Service::getChannels ();
106106
107- $ objectId = $ request ->get ('object_id ' );
107+ $ objectId = $ request ->request -> getInt ('object_id ' );
108108 $ object = AbstractObject::getById ($ objectId );
109109
110110 $ classList = $ this ->getFilteredClassDefinitionList ($ request );
@@ -166,7 +166,7 @@ private function getOutputDefinitionForObjectAndChannel($object, $classId, $chan
166166 public function resetOutputConfigAction (Request $ request )
167167 {
168168 try {
169- $ config = OutputDefinition::getById ($ request ->get ('config_id ' ));
169+ $ config = OutputDefinition::getById ($ request ->query -> getInt ('config_id ' ));
170170 $ config ->delete ();
171171
172172 return $ this ->jsonResponse (['success ' => true ]);
@@ -187,7 +187,7 @@ public function resetOutputConfigAction(Request $request)
187187 public function getOutputConfigAction (Request $ request )
188188 {
189189 try {
190- $ config = OutputDefinition::getById ($ request ->get ('config_id ' ));
190+ $ config = OutputDefinition::getById ($ request ->query -> getInt ('config_id ' ));
191191
192192 $ objectClass = ClassDefinition::getById ($ config ->getClassId ());
193193 $ configuration = json_decode ($ config ->getConfiguration ());
@@ -213,19 +213,17 @@ public function getOutputConfigAction(Request $request)
213213 public function getOrCreateOutputConfigAction (Request $ request )
214214 {
215215 try {
216- $ config = OutputDefinition::getById ($ request ->get ('config_id ' ));
216+ $ config = OutputDefinition::getById ($ request ->query -> getInt ('config_id ' ));
217217 $ class = null ;
218218 if (!$ config ) {
219- if (is_numeric ($ request ->get ('class_id ' ))) {
220- $ class = ClassDefinition::getById ($ request ->get ('class_id ' ));
221- } else {
222- $ class = ClassDefinition::getByName ($ request ->get ('class_id ' ));
219+ if ($ request ->query ->has ('class_id ' )) {
220+ $ class = ClassDefinition::getByName ($ request ->query ->getString ('class_id ' ));
223221 }
224222 if (!$ class ) {
225- throw new \Exception ('Class ' . $ request ->get ('class_id ' ) . ' not found. ' );
223+ throw new \Exception ('Class ' . $ request ->query -> getString ('class_id ' ) . ' not found. ' );
226224 }
227225
228- $ config = OutputDefinition::getByObjectIdClassIdChannel ($ request ->get ('objectId ' ), $ class ->getId (), $ request ->get ('channel ' ));
226+ $ config = OutputDefinition::getByObjectIdClassIdChannel ($ request ->query -> getInt ('objectId ' ), $ class ->getId (), $ request ->query -> getString ('channel ' ));
229227 }
230228
231229 if ($ config ) {
@@ -237,9 +235,9 @@ public function getOrCreateOutputConfigAction(Request $request)
237235 return $ this ->jsonResponse (['success ' => true , 'outputConfig ' => $ config ]);
238236 } else {
239237 $ config = new OutputDefinition ();
240- $ config ->setChannel ($ request ->get ('channel ' ));
238+ $ config ->setChannel ($ request ->query -> getString ('channel ' ));
241239 $ config ->setClassId ($ class ->getId ());
242- $ config ->setObjectId ($ request ->get ('objectId ' ));
240+ $ config ->setObjectId ($ request ->query -> getInt ('objectId ' ));
243241 $ config ->save ();
244242
245243 return $ this ->jsonResponse (['success ' => true , 'outputConfig ' => $ config ]);
@@ -314,8 +312,8 @@ private function sortAttributes(array &$attributes)
314312 */
315313 public function getAttributeLabelsAction (Request $ request )
316314 {
317- $ configration = json_decode ($ request ->get ('configuration ' ));
318- $ class = ClassDefinition::getById ($ request ->get ('classId ' ));
315+ $ configration = json_decode ($ request ->request -> getString ('configuration ' ));
316+ $ class = ClassDefinition::getById ($ request ->request -> getString ('classId ' ));
319317
320318 $ configration = $ this ->doGetAttributeLabels ($ configration , $ class );
321319
@@ -403,8 +401,8 @@ private function getFieldDefinition($attributeName, $objectClass)
403401 public function getFieldDefinitionAction (Request $ request )
404402 {
405403 try {
406- $ objectClass = ClassDefinition::getById ($ request ->get ('class_id ' ));
407- $ def = $ this ->getFieldDefinition ($ request ->get ('key ' ), $ objectClass );
404+ $ objectClass = ClassDefinition::getById ($ request ->query -> getString ('class_id ' ));
405+ $ def = $ this ->getFieldDefinition ($ request ->query -> getString ('key ' ), $ objectClass );
408406
409407 return $ this ->jsonResponse (['success ' => true , 'fieldDefinition ' => $ def ]);
410408 } catch (\Exception $ e ) {
@@ -423,21 +421,21 @@ public function getFieldDefinitionAction(Request $request)
423421 public function saveOutputConfigAction (Request $ request , EventDispatcherInterface $ eventDispatcher )
424422 {
425423 try {
426- $ config = OutputDefinition::getById ($ request ->get ('config_id ' ));
424+ $ config = OutputDefinition::getById ($ request ->request -> getInt ('config_id ' ));
427425
428- $ object = AbstractObject::getById ($ request ->get ('object_id ' ));
426+ $ object = AbstractObject::getById ($ request ->request -> getInt ('object_id ' ));
429427 if (empty ($ object )) {
430- throw new \Exception ('Data Object with ID ' . $ request ->get ('object_id ' ) . ' not found. ' );
428+ throw new \Exception ('Data Object with ID ' . $ request ->request -> getInt ('object_id ' ) . ' not found. ' );
431429 }
432- if ($ config ->getObjectId () != $ request ->get ('object_id ' )) {
430+ if ($ config ->getObjectId () != $ request ->request -> getInt ('object_id ' )) {
433431 $ newConfig = new OutputDefinition ();
434432 $ newConfig ->setChannel ($ config ->getChannel ());
435433 $ newConfig ->setClassId ($ config ->getClassId ());
436434 $ newConfig ->setObjectId ($ object ->getId ());
437435 $ config = $ newConfig ;
438436 }
439437
440- $ configJson = $ request ->get ('config ' );
438+ $ configJson = $ request ->request -> getString ('config ' );
441439 $ config ->setConfiguration ($ configJson );
442440
443441 $ event = new SaveConfigEvent ($ config );
@@ -469,8 +467,8 @@ private function getFilteredClassDefinitionList(Request $request): ClassDefiniti
469467 {
470468 $ classList = new ClassDefinition \Listing ();
471469
472- if ($ request ->get ('class_id ' )) {
473- $ classList ->setCondition ('id = ? ' , $ request ->get ('class_id ' ));
470+ if ($ request ->request -> has ('class_id ' )) {
471+ $ classList ->setCondition ('id = ? ' , $ request ->request -> getString ('class_id ' ));
474472 } elseif (!empty ($ this ->defaultGridClasses )) {
475473 $ allowedClassIds = [];
476474 foreach ($ this ->defaultGridClasses as $ allowedClass ) {
0 commit comments