'error', 'key' => 'entity', 'method' => 'getWorkflowAndUser', 'data' => '', ]; $token = $request->headers->get('x-auth-token'); $security->isGranted('MAESTRO_PROJECT_PROJECTS_READ', $token); $entity = $readQuery->getWorkflowAndUser($id); if (!empty($entity)) { $body['type'] = 'success'; $body['data'] = $entity; $respond->statusOK(); } else { $body['data'] = 'Project not found for id ' . $id . ' !'; $respond->statusNotFound(); } return $respond->createBody($body)->respond(); } }