function testFilter() { $query = new QuerySelect("connection_tests ct"); $query->addFilter("ct.id = 2"); $result = $query->run(); $this->assertTrue(sizeof($result) == 1); $this->assertTrue($result[0]['value'] == 'two'); }
public function getById($id) { $query = new QuerySelect($this->tableName); $query->addFilter($this->indexColumn . "= '" . $id . "'"); $result = $query->run(); if (sizeof($result) == 0) { return null; } return new $this->modelClass($result[0]); }