| @@ 221-226 (lines=6) @@ | ||
| 218 | 'user', 'BoincUser', $fields, $where_clause, $order_clause |
|
| 219 | ); |
|
| 220 | } |
|
| 221 | static function insert($clause) { |
|
| 222 | $db = BoincDb::get(); |
|
| 223 | $ret = $db->insert('user', $clause); |
|
| 224 | if (!$ret) return 0; |
|
| 225 | return $db->insert_id(); |
|
| 226 | } |
|
| 227 | function delete() { |
|
| 228 | $db = BoincDb::get(); |
|
| 229 | $db->delete_aux('profile', "userid=$this->id"); |
|
| @@ 244-249 (lines=6) @@ | ||
| 241 | ||
| 242 | class BoincTeam { |
|
| 243 | static $cache; |
|
| 244 | static function insert($clause) { |
|
| 245 | $db = BoincDb::get(); |
|
| 246 | $ret = $db->insert('team', $clause); |
|
| 247 | if (!$ret) return 0; |
|
| 248 | return $db->insert_id(); |
|
| 249 | } |
|
| 250 | static function lookup_id_nocache($id) { |
|
| 251 | $db = BoincDb::get(); |
|
| 252 | return $db->lookup_id($id, 'team', 'BoincTeam'); |
|
| @@ 344-349 (lines=6) @@ | ||
| 341 | $cpid = BoincDb::escape_string($cpid); |
|
| 342 | return $db->lookup('host', 'BoincHost', "host_cpid='$cpid'"); |
|
| 343 | } |
|
| 344 | static function insert($clause) { |
|
| 345 | $db = BoincDb::get(); |
|
| 346 | $ret = $db->insert('host', $clause); |
|
| 347 | if (!$ret) return $ret; |
|
| 348 | return $db->insert_id(); |
|
| 349 | } |
|
| 350 | static function delete_for_user($user_id) { |
|
| 351 | $db = BoincDb::get(); |
|
| 352 | return $db->delete_aux('host', "userid=$user_id"); |
|
| @@ 438-443 (lines=6) @@ | ||
| 435 | $db = BoincDb::get(); |
|
| 436 | return $db->enum('app', 'BoincApp', $where_clause); |
|
| 437 | } |
|
| 438 | static function insert($clause) { |
|
| 439 | $db = BoincDb::get(); |
|
| 440 | $ret = $db->insert('app', $clause); |
|
| 441 | if (!$ret) return $ret; |
|
| 442 | return $db->insert_id(); |
|
| 443 | } |
|
| 444 | function update($clause) { |
|
| 445 | $db = BoincDb::get(); |
|
| 446 | return $db->update($this, 'app', $clause); |
|
| @@ 867-872 (lines=6) @@ | ||
| 864 | ||
| 865 | class BoincHostDeleted { |
|
| 866 | ||
| 867 | static function insert_hosts_for_user($user) { |
|
| 868 | $now = time(); |
|
| 869 | $clause = "select id, host_cpid, $now from host where userid = $user->id"; |
|
| 870 | $db = BoincDb::get(); |
|
| 871 | return $db->insert('host_deleted', $clause); |
|
| 872 | } |
|
| 873 | ||
| 874 | static function delete_expired() { |
|
| 875 | $db = BoincDb::get(); |
|