protected function _fetchObjectList($result, $key='')
    {
        $array = array();
        while ($row = $result->fetch_object()) {
            if ($key) {
                $array[$row->$key] = $row;
            } else {
                $array[] = $row;
            }
        }

        $result->free();

        return $array;
    }
protected function _fetchObjectList($result, $key='')
    {
        $array = array();
        while ($row = $result->fetch_object()) {
            if ($key) {
                $array[$row->$key] = $row;
            } else {
                $array[] = $row;
            }
        }

        $result->free();

        return $array;
    }
protected function _fetchObjectList ( $ result , $ key = '' ) { $ array = array ( ) ; while ( $ row = $ result -> fetch_object ( ) ) { if ( $ key ) { $ array [ $ row -> $ key ] = $ row ; } else { $ array [ ] = $ row ; } } $ result -> free ( ) ; return $ array ; }
Fetch all rows of a result set as an array of objects

If <var>key</var> is not empty then the returned array is indexed by the value
of the database key.  Returns <var>null</var> if the query fails.

@param	mysqli_result  The result object. A result set identifier returned by the select() function
@param 	string 		   The column name of the index to use
@return 	array 	If <var>key</var> is empty as sequential array of returned rows.
Fetch all rows of a result set as an array of objects