MDL-62134 tool_dataprivacy: Add a manager_observer

This commit is contained in:
Andrew Nicols
2018-05-16 11:52:46 +08:00
parent 22c0a30888
commit 8760b7335b
6 changed files with 139 additions and 35 deletions
@@ -97,7 +97,9 @@ class initiate_data_request_task extends adhoc_task {
api::update_request_status($requestid, api::DATAREQUEST_STATUS_PREPROCESSING);
// Add the list of relevant contexts to the request, and mark all as pending approval.
$privacymanager = new manager();
$privacymanager = new \core_privacy\manager();
$privacymanager->set_observer(new \tool_dataprivacy\manager_observer());
$contextlistcollection = $privacymanager->get_contexts_for_userid($datarequest->get('userid'));
api::add_request_contexts_with_status($contextlistcollection, $requestid, contextlist_context::STATUS_PENDING);