Example #1
0
 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);
 }
Example #2
0
 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;
 }
Example #3
0
function testSelectAllQuery($t)
{
    $schema = NekoSchema::getInstance("user_master", "id", array("name", "age", "created_on"));
    $t->is($schema->selectAllQuery(), 'SELECT * FROM user_master', 'select all');
}