function __construct($dbh) { $schema = NekoSchema::getInstance("bookmarks", "id", array("user_id", "url", 'comment', "created_on", "updated_on")); $schema->addOnInsertTimestamp("created_on"); $schema->addOnInsertTimestamp("updated_on"); $schema->addOnUpdateTimestamp("updated_on"); parent::__construct($dbh, $schema); }
public function delete_where($cond) { $query = $this->schema->deleteWhereQuery($cond); $sth = NekoSchema::execute($this->dbh, $query); if ($sth === null) { $info = $this->dbh->errorInfo(); throw new Exception($info[2]); } return $sth; }
function testSelectAllQuery($t) { $schema = NekoSchema::getInstance("user_master", "id", array("name", "age", "created_on")); $t->is($schema->selectAllQuery(), 'SELECT * FROM user_master', 'select all'); }