Server: add some functions to PHP DB interface for platforms

- I'd like to transition from Python (and the clunky
  DB interface we developed) to PHP for tools like xadd
- I'd like to figure out how to change the PHP DB interface
  so that we can define generic functions like insert(), update() etc.
  just one, in a base class.
This commit is contained in:
David Anderson 2014-04-22 10:03:16 -07:00
parent 944e5a3b29
commit e5dc4bb3f1
1 changed files with 12 additions and 0 deletions

View File

@ -462,6 +462,18 @@ class BoincPlatform {
$db = BoincDb::get();
return $db->lookup_id($id, 'platform', 'BoincPlatform');
}
static function lookup($clause) {
$db = BoincDb::get();
return $db->lookup('platform', 'BoincPlatform', $clause);
}
function update($clause) {
$db = BoincDb::get();
return $db->update($this, 'platform', $clause);
}
static function insert($clause) {
$db = BoincDb::get();
return $db->insert('platform', $clause);
}
}
class BoincHostAppVersion {