@@ 83-95 (lines=13) @@ | ||
80 | return $this->sqlError('E0037'); |
|
81 | } |
|
82 | ||
83 | public function deleteNews($id) { |
|
84 | $this->debug->append("STA " . __METHOD__, 4); |
|
85 | if (!is_int($id)) return false; |
|
86 | $stmt = $this->mysqli->prepare("DELETE FROM $this->table WHERE id = ?"); |
|
87 | if ($this->checkStmt($stmt) && $stmt->bind_param('i', $id) && $stmt->execute() && $stmt->affected_rows == 1) |
|
88 | return true; |
|
89 | return $this->sqlError('E0036'); |
|
90 | } |
|
91 | ||
92 | /** |
|
93 | * Add a new mews entry to the table |
|
94 | * @param type string Type of the notification |
|
95 | * @return bool |
|
96 | **/ |
|
97 | public function addNews($account_id, $aData, $active=false) { |
|
98 | $this->debug->append("STA " . __METHOD__, 4); |
@@ 298-307 (lines=10) @@ | ||
295 | * @param id int Worker ID |
|
296 | * @return bool |
|
297 | **/ |
|
298 | public function deleteWorker($account_id, $id) { |
|
299 | $this->debug->append("STA " . __METHOD__, 4); |
|
300 | $stmt = $this->mysqli->prepare("DELETE FROM $this->table WHERE account_id = ? AND id = ? LIMIT 1"); |
|
301 | if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $account_id, $id) && $stmt->execute() && $stmt->affected_rows == 1) |
|
302 | return true; |
|
303 | return $this->sqlError('E0061'); |
|
304 | } |
|
305 | } |
|
306 | ||
307 | $worker = new Worker($config); |
|
308 | $worker->setDebug($debug); |
|
309 | $worker->setMysql($mysqli); |
|
310 | $worker->setMemcache($memcache); |