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'); }
public function testCollectWithArrayHashUsingString() { $utils = new Utils(); $this->assertEquals(["0a", "1a"], $utils->collect($this->array_hash, "a")); }