1 | <?php |
||
26 | class Give_Payment_Stats extends Give_Stats { |
||
27 | |||
28 | /** |
||
29 | * Retrieve sale stats |
||
30 | * |
||
31 | * @since 1.0 |
||
32 | * @access public |
||
33 | * |
||
34 | * @param $form_id int The donation form to retrieve stats for. If false, gets stats for all forms |
||
35 | * @param $start_date string|bool The starting date for which we'd like to filter our sale stats. If false, we'll use the default start date of `this_month` |
||
36 | * @param $end_date string|bool The end date for which we'd like to filter our sale stats. If false, we'll use the default end date of `this_month` |
||
37 | * @param $status string|array The sale status(es) to count. Only valid when retrieving global stats |
||
38 | * |
||
39 | * @return float|int Total amount of donations based on the passed arguments. |
||
40 | */ |
||
41 | public function get_sales( $form_id = 0, $start_date = false, $end_date = false, $status = 'publish' ) { |
||
73 | |||
74 | |||
75 | /** |
||
76 | * Retrieve earning stats |
||
77 | * |
||
78 | * @since 1.0 |
||
79 | * @access public |
||
80 | * |
||
81 | * @param $form_id int The donation form to retrieve stats for. If false, gets stats for all forms. |
||
82 | * @param $start_date string|bool The starting date for which we'd like to filter our donation earnings stats. If false, method will use the default start date of `this_month`. |
||
83 | * @param $end_date string|bool The end date for which we'd like to filter the donations stats. If false, method will use the default end date of `this_month`. |
||
84 | * @param $gateway_id string|bool The gateway to get earnings for such as 'paypal' or 'stripe'. |
||
85 | * |
||
86 | * @return float|int Total amount of donations based on the passed arguments. |
||
87 | 2 | */ |
|
88 | public function get_earnings( $form_id = 0, $start_date = false, $end_date = false, $gateway_id = false ) { |
||
159 | 2 | ||
160 | /** |
||
161 | 2 | * Retrieve earning stat transient key |
|
162 | * |
||
163 | * @since 1.0 |
||
164 | * @access public |
||
165 | * |
||
166 | * @param $form_id int The donation form to retrieve stats for. If false, gets stats for all forms |
||
167 | * @param $start_date string|bool The starting date for which we'd like to filter our donation earnings stats. If false, we'll use the default start date of `this_month` |
||
168 | * @param $end_date string|bool The end date for which we'd like to filter our sale stats. If false, we'll use the default end date of `this_month` |
||
169 | * @param $gateway_id string|bool The gateway to get earnings for such as 'paypal' or 'stripe' |
||
170 | * |
||
171 | * @return float|int Total amount of donations based on the passed arguments. |
||
172 | */ |
||
173 | public function get_earnings_cache_key( $form_id = 0, $start_date = false, $end_date = false, $gateway_id = false ) { |
||
224 | 1 | ||
225 | /** |
||
226 | 1 | * Get the best selling forms |
|
227 | * |
||
228 | 1 | * @since 1.0 |
|
229 | * @access public |
||
230 | 1 | * |
|
231 | 1 | * @param $number int The number of results to retrieve with the default set to 10. |
|
232 | * |
||
233 | 1 | * @return array Best selling forms |
|
234 | */ |
||
235 | public function get_best_selling( $number = 10 ) { |
||
248 | |||
249 | } |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.