/** * Add a new server * * @param string $name The name of the server * @param string $domain The domain of the server (e.g. server.com) * @param string $port The port of the server (e.g. 5154) * @param int $country The ID of the country * @param int $owner The ID of the server owner * * @return Server An object that represents the sent message */ public static function addServer($name, $domain, $port, $country, $owner) { $key = ApiKey::getKeyByOwner($owner); $server = self::create(array('name' => $name, 'domain' => $domain, 'port' => $port, 'country' => $country, 'owner' => $owner, 'api_key' => $key->getId(), 'status' => 'active'), 'updated'); $server->forceUpdate(); return $server; }