Ejemplo n.º 1
0
 private function limit($offset, $limit)
 {
     $ret = [];
     $sql = 'SELECT * FROM authors ORDER BY name ASC';
     $this->conn->queryAndFetch($this->conn->limit($sql, $offset, $limit), function ($row) use(&$ret) {
         $ret[] = $row;
     });
     $return = new Utils();
     return $return->collect($ret, 'author_id');
 }
Ejemplo n.º 2
0
 public function testCollectWithArrayHashUsingString()
 {
     $utils = new Utils();
     $this->assertEquals(["0a", "1a"], $utils->collect($this->array_hash, "a"));
 }