Shared access to the database for GrimaUser and GrimaInstitution.
More...
Shared access to the database for GrimaUser and GrimaInstitution.
Definition at line 3132 of file grima-lib.php.
◆ getDb()
| static GrimaDB::getDb |
( |
| ) |
|
|
staticprotected |
◆ getIterator()
Definition at line 3189 of file grima-lib.php.
3190 return new ArrayIterator($this->info);
◆ getPasswordAlgorithm()
| GrimaDB::getPasswordAlgorithm |
( |
| ) |
|
|
protected |
◆ init()
Definition at line 3133 of file grima-lib.php.
References $db, and tableExists().
3135 $db = self::getDb();
3137 $db->exec(
"CREATE TABLE institutions ( institution VARCHAR(100) PRIMARY KEY, apikey VARCHAR(100), server VARCHAR(100) )");
3140 $db->exec(
"CREATE TABLE users ( institution VARCHAR(100), username VARCHAR(100), password VARCHAR(255), isAdmin BOOLEAN )");
3143 }
catch(Exception $x) {
3144 # create the database tableExists($pdo, $table)
◆ isEmpty()
| static GrimaDB::isEmpty |
( |
| ) |
|
|
static |
Definition at line 3148 of file grima-lib.php.
References $db.
3150 $db = self::getDb();
3151 $result =
$db->query(
'SELECT COUNT(*) as c FROM institutions' );
3152 foreach( $result as $row ) {
3153 if ($row[
'c']>0)
return false;
◆ offsetExists()
| GrimaDB::offsetExists |
( |
|
$offset | ) |
|
Definition at line 3173 of file grima-lib.php.
3174 return isset($this->info[$offset]);
◆ offsetGet()
| GrimaDB::offsetGet |
( |
|
$offset | ) |
|
Definition at line 3177 of file grima-lib.php.
3178 return isset($this->info[$offset]) ? $this->info[$offset] :
'';
◆ offsetSet()
| GrimaDB::offsetSet |
( |
|
$offset, |
|
|
|
$value |
|
) |
| |
◆ offsetUnset()
| GrimaDB::offsetUnset |
( |
|
$offset | ) |
|
◆ $db
◆ $info
The documentation for this class was generated from the following file: