'error', 'key' => 'variable', 'method' => 'list', 'data' => '', ]; $token = $request->headers->get('x-auth-token'); $security->isGranted('MAESTRO_PROJECT_TEMPLATE_UPDATE', $token); $list = $query->listSort(); $body['data'] = $list; if (is_array($list)) { $body['type'] = 'success'; $respond->statusOk(); } else { $respond->statusUnprocessableEntity(); } return $respond->createBody($body)->respond(); } }