function find($condition = "", $order = "", $limit = "")
{
global $DB;
// Make new database object and fill variables
$query = "SELECT *\n FROM `" . $this->getTable() . "`";
if (!empty($condition)) {
$query .= " WHERE {$condition}";
}
if (!empty($order)) {
$query .= " ORDER BY {$order}";
}
if (!empty($limit)) {
$query .= " LIMIT " . intval($limit);
}
$data = array();
if ($result = $DB->query($query)) {
if ($DB->numrows($result)) {
while ($line = $DB->fetch_assoc($result)) {
$data[$line['id']] = $line;
}
}
}
return $data;
}