Code Duplication    Length = 10-13 lines in 2 locations

include/classes/news.class.php 1 location

@@ 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);

include/classes/worker.class.php 1 location

@@ 299-308 (lines=10) @@
296
   * @param id int Worker ID
297
   * @return bool
298
   **/
299
  public function deleteWorker($account_id, $id) {
300
    $this->debug->append("STA " . __METHOD__, 4);
301
    $stmt = $this->mysqli->prepare("DELETE FROM $this->table WHERE account_id = ? AND id = ? LIMIT 1");
302
    if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $account_id, $id) && $stmt->execute() && $stmt->affected_rows == 1)
303
        return true;
304
    return $this->sqlError('E0061');
305
  }
306
}
307
308
$worker = new Worker($config);
309
$worker->setDebug($debug);
310
$worker->setMysql($mysqli);
311
$worker->setMemcache($memcache);