'error', 'key' => 'project', 'method' => 'delete', 'data' => '' ]; $token = $request->headers->get('x-auth-token'); $security->isGranted('MAESTRO_PROJECT_PROJECTS_DELETE', $token); $userId = $security->getUser()->getId(); $view = new CommonIdView( $id ); $deleted = $deleteQuery->delete($view); $body['data'] = $deleted; if ($deleted) { $body['type'] = "success"; $respond->statusOk(); //DELETE THE CACHE IF WE HAVE, BECAUSE THE VALUE WAS CHANGED $cache = new FilesystemAdapter(); $cache->clear(); //END DELETING CACHE } else { $respond->statusUnprocessableEntity(); } return $respond->createBody($body)->respond(); } }