Fixed PHP 5.2 compatibility.
This commit is contained in:
parent
6e68247701
commit
b8dff97e00
|
@ -262,4 +262,14 @@ class WC_Admin_Reports_Categories_Data_Store extends WC_Admin_Reports_Data_Store
|
|||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns string to be used as cache key for the data.
|
||||
*
|
||||
* @param array $params Query parameters.
|
||||
* @return string
|
||||
*/
|
||||
protected function get_cache_key( $params ) {
|
||||
return 'woocommerce_' . self::TABLE_NAME . '_' . md5( wp_json_encode( $params ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -282,17 +282,6 @@ class WC_Admin_Reports_Data_Store {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns string to be used as cache key for the data.
|
||||
*
|
||||
* @param array $params Query parameters.
|
||||
* @return string
|
||||
*/
|
||||
protected function get_cache_key( $params ) {
|
||||
// TODO: this is not working in PHP 5.2 (but revenue class has static methods, so it cannot use object property).
|
||||
return 'woocommerce_' . $this::TABLE_NAME . '_' . md5( wp_json_encode( $params ) ); // phpcs:ignore PHPCompatibility.Syntax.NewDynamicAccessToStatic
|
||||
}
|
||||
|
||||
/**
|
||||
* Casts strings returned from the database to appropriate data types for output.
|
||||
*
|
||||
|
|
|
@ -531,4 +531,14 @@ class WC_Admin_Reports_Orders_Data_Store extends WC_Admin_Reports_Data_Store imp
|
|||
|
||||
return count( $customer_orders ) > 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns string to be used as cache key for the data.
|
||||
*
|
||||
* @param array $params Query parameters.
|
||||
* @return string
|
||||
*/
|
||||
protected function get_cache_key( $params ) {
|
||||
return 'woocommerce_' . self::TABLE_NAME . '_' . md5( wp_json_encode( $params ) );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -261,4 +261,14 @@ class WC_Admin_Reports_Products_Data_Store extends WC_Admin_Reports_Data_Store i
|
|||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns string to be used as cache key for the data.
|
||||
*
|
||||
* @param array $params Query parameters.
|
||||
* @return string
|
||||
*/
|
||||
protected function get_cache_key( $params ) {
|
||||
return 'woocommerce_' . self::TABLE_NAME . '_' . md5( wp_json_encode( $params ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -261,4 +261,14 @@ class WC_Admin_Reports_Variations_Data_Store extends WC_Admin_Reports_Data_Store
|
|||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns string to be used as cache key for the data.
|
||||
*
|
||||
* @param array $params Query parameters.
|
||||
* @return string
|
||||
*/
|
||||
protected function get_cache_key( $params ) {
|
||||
return 'woocommerce_' . self::TABLE_NAME . '_' . md5( wp_json_encode( $params ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue