| @@ -56,14 +56,12 @@ | ||
| 56 | 56 | /** |
| 57 | 57 | * Fetches information from source, parses it and builds series and data arrays. |
| 58 | 58 | * |
| 59 | 59 | * @param bool $as_html Should the result be fetched as an HTML table or as an object. |
| 60 | - * @param bool $results_as_numeric_array Should the result be fetched as ARRAY_N instead of ARRAY_A. | |
| 61 | - * @param bool $raw_results Should the result be returned without processing. | |
| 62 | 60 | * @access public |
| 63 | 61 | * @return boolean TRUE on success, otherwise FALSE. |
| 64 | 62 | */ |
| 65 | - public function fetch( $as_html = false, $results_as_numeric_array = false, $raw_results = false ) { | |
| 63 | + public function fetch( $as_html = false ) { | |
| 66 | 64 | if ( empty( $this->_query ) ) { |
| 67 | 65 | return false; |
| 68 | 66 | } |
| 69 | 67 | |
| @@ -68,22 +66,17 @@ | ||
| 68 | 66 | } |
| 69 | 67 | |
| 70 | 68 | // impose a limit if no limit clause is provided. |
| 71 | 69 | if ( strpos( strtolower( $this->_query ), ' limit ' ) === false ) { |
| 72 | - $this->_query .= ' LIMIT ' . apply_filters( 'visualizer_sql_query_limit', 1000 ); | |
| 70 | + $this->_query .= ' LIMIT ' . apply_filters( 'visualizer_sql_query_limit', 300 ); | |
| 73 | 71 | } |
| 74 | 72 | |
| 75 | 73 | global $wpdb; |
| 76 | 74 | $wpdb->hide_errors(); |
| 77 | 75 | // @codingStandardsIgnoreStart |
| 78 | - $rows = $wpdb->get_results( $this->_query, $results_as_numeric_array ? ARRAY_N : ARRAY_A ); | |
| 79 | - do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Firing query %s to get results %s with error %s', $this->_query, print_r( $rows, true ), print_r( $wpdb->last_error, true ) ), 'debug', __FILE__, __LINE__ ); | |
| 76 | + $rows = $wpdb->get_results( $this->_query, ARRAY_A ); | |
| 80 | 77 | // @codingStandardsIgnoreEnd |
| 81 | 78 | $wpdb->show_errors(); |
| 82 | - | |
| 83 | - if ( $raw_results ) { | |
| 84 | - return $rows; | |
| 85 | - } | |
| 86 | 79 | |
| 87 | 80 | if ( $rows ) { |
| 88 | 81 | $results = array(); |
| 89 | 82 | $headers = array(); |