add method remove(), add optional parameter to getParameter()

This commit is contained in:
Uwe Steinmann 2020-05-19 08:06:09 +02:00
parent 204387237f
commit 92bf2e1d69

View File

@ -248,7 +248,9 @@ class SeedDMS_SchedulerTask {
return true;
} /* }}} */
public function getParameter() {
public function getParameter($name = '') {
if($name)
return isset($this->_params[$name]) ? $this->_params[$name] : null;
return $this->_params;
}
@ -275,4 +277,21 @@ class SeedDMS_SchedulerTask {
$this->_lastrun = $lastrun;
$this->_nextrun = $nextrun;
}
/**
* Delete task
*
* @return boolean true on success or false in case of an error
*/
function remove() { /* {{{ */
$db = $this->db;
$queryStr = "DELETE FROM `tblSchedulerTask` WHERE `id` = " . $this->_id;
if (!$db->getResult($queryStr)) {
return false;
}
return true;
} /* }}} */
}