DBDriver Test
dbc = WBClass::create('WBDatabaseConnector', $params);
}
public function getTableInfo($table)
{
return $this->dbc->getTableInfo($table);
}
public function query($query)
{
}
public function get($table)
{
$list = array();
$res = $this->dbc->get($table);
foreach ($res as $r) {
$list[] = $r;
}
return $list;
}
public function addNDel()
{
$table = 'user';
$save = array(
'forename' => 'joe',
'surname' => 'doe',
'emaillocal' => 'joedoe',
'emaildomain' => 'example.com'
);
$id = $this->dbc->save($table, '__new', $save);
echo "new id: $id
";
$this->dbc->delete($table, $id);
}
}
$dbc = new TestDBC();
echo "getTableInfo" . print_r($dbc->getTableInfo('user'), true) . "
\n";
$dbc->addNDel();
$list = $dbc->get('user');
echo "get(user)" . var_export($list, true) . "
\n";
?>