'error', 'key' => 'elementMedia', 'method' => 'updateField', 'data' => '', ]; $token = $request->headers->get('x-auth-token'); $security->isGranted("MAESTRO_PROJECT_PROJECTS_UPDATE", $token); $data = json_decode($request->getContent(), true); $updated = $updateQuery->updateField($id, $data); if (!$updated instanceof Exception) { $body['type'] = 'success'; $body['data'] = $updated; $respond->statusOK(); //DELETE THE CACHE IF WE HAVE, BECAUSE THE VALUE WAS CHANGED if (isset($data['pageId']) && (int)$data['pageId'] > 0) { $cache = new FilesystemAdapter(); $cache->clear(); } //END DELETING CACHE } else { $body['data'] = $updated->getMessage(); $respond->statusUnprocessableEntity(); } return $respond->createBody($body)->respond(); } }