mirror of https://github.com/BOINC/boinc.git
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:
parent
944e5a3b29
commit
e5dc4bb3f1
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue