/** * Remove one or more entries * * @return void */ public function removeTask() { // Check for request forgeries Request::checkToken(); // Incoming $wish = Request::getInt('wish', 0); $ids = Request::getVar('id', array()); $ids = !is_array($ids) ? array($ids) : $ids; // Do we have any IDs? if (count($ids) > 0) { $tbl = new Comment($this->database); // Loop through each ID foreach ($ids as $id) { $id = intval($id); if (!$tbl->delete($id)) { throw new Exception($tbl->getError(), 500); } } } // Redirect App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&wish=' . $wish, false), Lang::txt('COM_WISHLIST_ITEMS_REMOVED', count($ids))); }