Differences Between: [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]
(no description)
File Size: | 249 lines (9 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
audience:: (8 methods):
get_base_records()
get_allowed_reports()
purge_caches()
user_reports_list_sql()
user_reports_list()
user_audience_sql()
get_audience_types()
get_all_audiences_menu_types()
get_base_records(int $reportid) X-Ref |
Return audience instances for a given report. Note that any records pointing to invalid audience types will be excluded return: base[] param: int $reportid |
get_allowed_reports(?int $userid = null) X-Ref |
Returns list of reports that the specified user can access. Note this is potentially very expensive to calculate if a site has lots of reports, with lots of audiences, so we cache the result for the duration of the users session return: array param: int|null $userid User ID to check, or the current user if omitted |
purge_caches() X-Ref |
Purge the audience cache of allowed reports |
user_reports_list_sql(string $reporttablealias, ?int $userid = null) X-Ref |
Generate SQL select clause and params for selecting reports specified user can access return: array param: string $reporttablealias param: int|null $userid User ID to check, or the current user if omitted |
user_reports_list(?int $userid = null) X-Ref |
Return list of report ID's specified user can access return: int[] param: int|null $userid User ID to check, or the current user if omitted |
user_audience_sql(array $audiences, string $usertablealias = 'u') X-Ref |
Return appropriate list of where clauses and params for given audiences return: array[] [$wheres, $params] param: audience_model[] $audiences param: string $usertablealias |
get_audience_types() X-Ref |
Returns the list of audiences types in the system. return: array |
get_all_audiences_menu_types() X-Ref |
Get all the audiences types the current user can add to, organised by categories. return: array |