'error', 'key' => 'twig', 'method' => 'UpdateVariable', 'data' => '', ]; $token = $request->headers->get('x-auth-token'); $security->isGranted('MAESTRO_PROJECT_TEMPLATE_UPDATE', $token); $data = json_decode($request->getContent(), true); $twig = $query->UpdateVariable($data['variables'], $id); if ($twig) { $body['type'] = 'success'; $body['data'] = $twig; $respond->statusOk(); //DELETE THE CACHE IF WE HAVE, BECAUSE THE VALUE WAS CHANGED $cache = new FilesystemAdapter(); $cache->clear(); //END DELETING CACHE } else { $body['method'] = 'read'; $body['data'] = "No Twig found for id : $id !"; $respond->statusUnprocessableEntity(); } return $respond->createBody($body)->respond(); } }