/** * @param JBDatabaseQuery $select * @return mixed */ public function fetchList(JBDatabaseQuery $select) { $selectSql = (string) $select; $this->app->jbdebug->sql($selectSql); $this->_db->setQuery($selectSql); $rows = $this->_db->loadRowList(); $result = $this->_groupBy($rows, '0'); return $result; }
/** * Test loadRowList method * * @return void * * @since 11.4 */ public function testLoadRowList() { $query = $this->object->getQuery(true); $query->select('*'); $query->from('jos_dbtest'); $query->where('description=' . $this->object->quote('one')); $this->object->setQuery($query); $result = $this->object->loadRowList(); $expected = array(array(1, 'Testing', '1980-04-18 00:00:00', 'one'), array(2, 'Testing2', '1980-04-18 00:00:00', 'one')); $this->assertThat($result, $this->equalTo($expected), __LINE__); }
/** * Load a list of database rows (numeric column indexing) * * @param string $key field name of a primary key * @throws SPException * @return array If <var>key</var> is empty as sequential list of returned records. */ public function loadRowList($key = null) { try { $r = $this->db->loadRowList($key); $this->count++; } catch (Exception $e) { } if ($this->db->getErrorNum()) { throw new SPException($this->db->stderr()); } else { return $r; } }