public function update($props)
{
if (!$this->serverId) {
throw new RuntimeException(sprintf("Server identifier has not been set in %s object yet.", get_class($this)));
}
$stmt = [];
foreach ($props as $prop => $value) {
if (!($column = array_search($prop, static::$FieldPropertyMap))) {
throw new InvalidArgumentException(sprintf("Invalid property '%s' in the %s object.", $prop, get_class($this)));
}
$this->{$prop} = $value;
$stmt[] = "`" . $column . "` = " . $this->Db->qstr($value);
}
if (!empty($stmt)) {
$this->Db->Execute("\n UPDATE `servers` SET " . join(", ", $stmt) . " WHERE `server_id`= " . $this->Db->qstr($this->serverId) . "\n ");
}
return $this;
}