DataStore
Admin\API\Reports\DataStore: Common parent for custom report data stores.
Description Description
Source Source
File: packages/woocommerce-admin/src/API/Reports/DataStore.php
Methods Methods
- __construct — Class constructor.
- add_intervals_sql_params — Fills FROM and WHERE clauses of SQL request for 'Intervals' section of data response based on user supplied parameters.
- add_order_by_clause — Add order by SQL clause if included in query.
- add_order_by_sql_params — Fills ORDER BY clause of SQL request based on user supplied parameters.
- add_order_status_clause — Add order status SQL clauses if included in query.
- add_orderby_order_clause — Add order by order SQL clause.
- add_time_period_sql_params — Fills WHERE clause of SQL request with date-related constraints.
- assign_report_columns — Assign report columns once full table name has been assigned.
- cast_numbers — Casts strings returned from the database to appropriate data types for output.
- create_interval_subtotals — Change structure of intervals to form a correct response.
- expected_intervals_on_page — Returns expected number of items on the page in case of date ordering.
- fill_in_missing_intervals — Fills in interval gaps from DB with 0-filled objects.
- format_join_selections — Returns a comma separated list of the field names prepared to be used for a selection after a join with `default_results`.
- get_attribute_subqueries — Returns product attribute subquery elements used in JOIN and WHERE clauses, based on query arguments from the user.
- get_cache_key — Returns string to be used as cache key for the data.
- get_cached_data — Wrapper around Cache::get().
- get_customer_subquery — Returns customer subquery to be used in WHERE SQL query, based on query arguments from the user.
- get_db_table_name — Get table name from database class.
- get_excluded_coupons — Returns comma separated ids of excluded coupons, based on query arguments from the user.
- get_excluded_orders — Returns comma separated ids of excluded orders, based on query arguments from the user.
- get_excluded_products — Returns comma separated ids of excluded products, based on query arguments from the user.
- get_excluded_products_array — Returns an array of ids of disallowed products, based on query arguments from the user.
- get_excluded_report_order_statuses — Get the excluded order statuses used when calculating reports.
- get_excluded_users — Returns comma separated ids of excluded users, based on query arguments from the user.
- get_excluded_variations — Returns comma separated ids of excluded variations, based on query arguments from the user.
- get_fields — Returns a comma separated list of the fields in the `query_args`, if there aren't, returns `report_columns` keys.
- get_filtered_ids — Returns filtered comma separated ids, based on query arguments from the user.
- get_ids_table — Generates a virtual table given a list of IDs.
- get_included_categories — Returns comma separated ids of included categories, based on query arguments from the user.
- get_included_coupons — Returns comma separated ids of included coupons, based on query arguments from the user.
- get_included_orders — Returns comma separated ids of included orders, based on query arguments from the user.
- get_included_products — Returns comma separated ids of allowed products, based on query arguments from the user.
- get_included_products_array — Returns an array of ids of allowed products, based on query arguments from the user.
- get_included_users — Returns comma separated ids of included users, based on query arguments from the user.
- get_included_variations — Returns comma separated ids of allowed variations, based on query arguments from the user.
- get_limit_params — Fills LIMIT parameters of SQL request based on user supplied parameters.
- get_limit_sql_params — Fills LIMIT clause of SQL request based on user supplied parameters.
- get_match_operator — Returns logic operator for WHERE subclause based on 'match' query argument.
- get_object_where_filter — Get WHERE filter by object ids subquery.
- get_products_by_cat_ids — Returns an array of products belonging to given categories.
- get_refund_subquery — Get join and where clauses for refunds based on user supplied parameters.
- get_status_subquery — Returns order status subquery to be used in WHERE SQL query, based on query arguments from the user.
- interval_cmp — Compares two report data objects by pre-defined object property and ASC/DESC ordering.
- intervals_missing — Returns true if there are any intervals that need to be filled in the response.
- normalize_order_by — Normalizes order_by clause to match to SQL query.
- normalize_order_status — Maps order status provided by the user to the one used in the database.
- normalize_timezones — Converts input datetime parameters to local timezone. If there are no inputs from the user in query_args, uses default from $defaults.
- remove_extra_records — Removes extra records from intervals so that only requested number of records get returned.
- selected_columns — Returns a list of columns selected by the query_args formatted as a comma separated string.
- set_cached_data — Wrapper around Cache::set().
- set_db_table_name — Set table name from database class.
- should_use_cache — Whether or not the report should use the caching layer.
- sort_array — Sorts array of arrays based on subarray key $sort_by.
- sort_intervals — Sorts intervals according to user's request.
- update_interval_boundary_dates — Updates start and end dates for intervals so that they represent intervals' borders, not times when data in db were recorded.
- update_intervals_sql_params — Updates the LIMIT query part for Intervals query of the report.