Privacy Subsystem implementation for core_ratings.
More...
|
static | delete_ratings (\context $context, string $component=null, string $ratingarea=null, int $itemid=null) |
| Deletes all ratings for a specified context, component, ratingarea and itemid. More...
|
|
static | delete_ratings_select (\context $context, string $component, string $ratingarea, $itemidstest, $params=[]) |
| Deletes all tag instances for given context, component, itemtype using subquery for itemids. More...
|
|
static | export_area_ratings (int $userid, context $context, array $subcontext, string $component, string $ratingarea, int $itemid, bool $onlyuser=true) |
| Export all ratings which match the specified component, areaid, and itemid. More...
|
|
static | get_metadata (collection $collection) |
| Returns metadata about the ratings subsystem. More...
|
|
static | get_sql_join ($alias, $component, $ratingarea, $itemidjoin, $userid, $innerjoin=false) |
| Get the SQL required to find all submission items where this user has had any involvements. More...
|
|
static | get_users_in_context_from_sql (userlist $userlist, string $alias, string $component, string $area, string $insql, $params) |
| Add the list of users who have rated in the specified constraints. More...
|
|
Privacy Subsystem implementation for core_ratings.
- Copyright
- 2018 Andrew Nicols andre.nosp@m.w@ni.nosp@m.cols..nosp@m.co.u.nosp@m.k
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ delete_ratings()
static core_rating\privacy\provider::delete_ratings |
( |
\context |
$context, |
|
|
string |
$component = null , |
|
|
string |
$ratingarea = null , |
|
|
int |
$itemid = null |
|
) |
| |
|
static |
Deletes all ratings for a specified context, component, ratingarea and itemid.
Only delete ratings when the item itself was deleted.
We never delete ratings for one user but not others - this may affect grades, therefore ratings made by particular user are not considered personal information.
- Parameters
-
context | $context | Details about which context to delete ratings for. |
string | $component | Component to delete. |
string | $ratingarea | Rating area to delete. |
int | $itemid | The item ID for use with deletion. |
◆ delete_ratings_select()
static core_rating\privacy\provider::delete_ratings_select |
( |
\context |
$context, |
|
|
string |
$component, |
|
|
string |
$ratingarea, |
|
|
|
$itemidstest, |
|
|
|
$params = [] |
|
) |
| |
|
static |
Deletes all tag instances for given context, component, itemtype using subquery for itemids.
In most situations you will want to specify $userid as null. Per-user tag instances are possible in Tags API, however there are no components or standard plugins that actually use them.
- Parameters
-
context | $context | Details about which context to delete ratings for. |
string | $component | Component to delete. |
string | $ratingarea | Rating area to delete. |
string | $itemidstest | an SQL fragment that the itemid must match. Used in the query like WHERE itemid $itemidstest. Must use named parameters, and may not use named parameters called contextid, component or ratingarea. |
array | $params | any query params used by $itemidstest. |
◆ export_area_ratings()
static core_rating\privacy\provider::export_area_ratings |
( |
int |
$userid, |
|
|
context |
$context, |
|
|
array |
$subcontext, |
|
|
string |
$component, |
|
|
string |
$ratingarea, |
|
|
int |
$itemid, |
|
|
bool |
$onlyuser = true |
|
) |
| |
|
static |
Export all ratings which match the specified component, areaid, and itemid.
If requesting ratings for a users own content, and you wish to include all ratings of that content, specify $onlyuser as false.
When requesting ratings for another users content, you should only export the ratings that the specified user made themselves.
- Parameters
-
int | $userid | The user whose information is to be exported |
context | $context | The context being stored. |
array | $subcontext | The subcontext within the context to export this information |
string | $component | The component to fetch data from |
string | $ratingarea | The ratingarea that the data was stored in within the component |
int | $itemid | The itemid within that ratingarea |
bool | $onlyuser | Whether to only export ratings that the current user has made, or all ratings |
◆ get_metadata()
static core_rating\privacy\provider::get_metadata |
( |
collection |
$collection | ) |
|
|
static |
Returns metadata about the ratings subsystem.
- Parameters
-
collection | $collection | The initialised collection to add items to. |
- Return values
-
collection | A listing of user data stored through the subsystem. |
Implements core_privacy\local\metadata\provider.
◆ get_sql_join()
static core_rating\privacy\provider::get_sql_join |
( |
|
$alias, |
|
|
|
$component, |
|
|
|
$ratingarea, |
|
|
|
$itemidjoin, |
|
|
|
$userid, |
|
|
|
$innerjoin = false |
|
) |
| |
|
static |
Get the SQL required to find all submission items where this user has had any involvements.
If possible an inner join should be used.
- Parameters
-
string | $alias | The name of the table alias to use. |
string | $component | The na eof the component to fetch ratings for. |
string | $ratingarea | The rating area to fetch results for. |
string | $itemidjoin | The right-hand-side of the JOIN ON clause. |
int | $userid | The ID of the user being stored. |
bool | $innerjoin | Whether to use an inner join (preferred) |
- Return values
-
◆ get_users_in_context_from_sql()
static core_rating\privacy\provider::get_users_in_context_from_sql |
( |
userlist |
$userlist, |
|
|
string |
$alias, |
|
|
string |
$component, |
|
|
string |
$area, |
|
|
string |
$insql, |
|
|
|
$params |
|
) |
| |
|
static |
Add the list of users who have rated in the specified constraints.
- Parameters
-
userlist | $userlist | The userlist to add the users to. |
string | $alias | An alias prefix to use for rating selects to avoid interference with your own sql. |
string | $component | The component to check. |
string | $area | The rating area to check. |
string | $insql | The SQL to use in a sub-select for the itemid query. |
array | $params | The params required for the insql. |
The documentation for this class was generated from the following file: