'error', 'key' => 'project', 'method' => 'read', 'data' => '' ]; $token = $request->headers->get('x-auth-token'); $security->isGranted('MAESTRO_PROJECT_PROJECTS_READ', $token); $entity = $readQuery->read($id); if ($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(); } }