Beispiel #1
0
                }
            } else {
                return true;
            }
        }
        return $this->sqlError('E0060');
    }
    /**
     * Delete existing worker from account
     * @param account_id int User ID
     * @param id int Worker ID
     * @return bool
     **/
    public function deleteWorker($account_id, $id)
    {
        $this->debug->append("STA " . __METHOD__, 4);
        $stmt = $this->mysqli->prepare("DELETE FROM {$this->table} WHERE account_id = ? AND id = ? LIMIT 1");
        if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $account_id, $id) && $stmt->execute() && $stmt->affected_rows == 1) {
            return true;
        }
        return $this->sqlError('E0061');
    }
}
$worker = new Worker();
$worker->setDebug($debug);
$worker->setMysql($mysqli);
$worker->setMemcache($memcache);
$worker->setShare($share);
$worker->setConfig($config);
$worker->setUser($user);
$worker->setErrorCodes($aErrorCodes);