/** * delete source * json * * @return void */ public function remove() { $this->needsLoggedIn(); $id = \F3::get('PARAMS["id"]'); $sourceDao = new \daos\Sources(); if (!$sourceDao->isValid('id', $id)) { $this->view->error('invalid id given'); } $sourceDao->delete($id); // cleanup tags $tagsDao = new \daos\Tags(); $allTags = $sourceDao->getAllTags(); $tagsDao->cleanup($allTags); $this->view->jsonSuccess(array('success' => true)); }