Sets the userList value for this LogicalUserListOperand.

@param userList
184982
public void setUserList(com.google.api.ads.adwords.axis.v201809.rm.UserList userList) {
        this.userList = userList;
    }
278814
public static function delete_data_for_users(approved_userlist $userlist) {
        global $DB;

        $context = $userlist->get_context();

        if ($context->contextlevel != CONTEXT_COURSE) {
            return;
        }

        $userids = $userlist->get_userids();

        list($insql, $inparams) = $DB->get_in_or_equal($userids, SQL_PARAMS_NAMED);
        $params = array_merge(['courseid' => $context->instanceid], $inparams);
        $sql = "courseid = :courseid AND userid $insql";
        $DB->delete_records_select('enrol_flatfile', $sql, $params);
    }
965992
public static function get_users_in_context(userlist $userlist) {

        if (empty($userlist)) {
            return;
        }

        $context = $userlist->get_context();

        // Include users who created or modified role capabilities.
        $sql = "SELECT modifierid as userid
                  FROM {role_capabilities}
                 WHERE contextid = :contextid";

        $params = [
            'contextid' => $context->id
        ];

        $userlist->add_from_sql('userid', $sql, $params);

        // Include users that have a role assigned to them.
        $sql = "SELECT userid
                  FROM {role_assignments}
                 WHERE contextid = :contextid";

        $userlist->add_from_sql('userid', $sql, $params);

        // Include users who created or modified the role assignment.
        // Differentiate and exclude special cases where tool_cohortroles adds records through the
        // "Assign user roles to cohort" feature into the role_assignments table.
        // These records should be separately processed in tool_cohortroles.
        $sql = "SELECT modifierid as userid
                  FROM {role_assignments}
                 WHERE contextid = :contextid
                       AND component != 'tool_cohortroles'";

        $userlist->add_from_sql('userid', $sql, $params);
    }
984632
public static function get_users_in_context(userlist $userlist) {
        $context = $userlist->get_context();

        if (!is_a($context, \context_user::class)) {
            return;
        }

        // Add users based on userkey.
        \core_userkey\privacy\provider::get_user_contexts_with_script($userlist, $context, 'tool_mobile');
    }
377410
public static function get_users_in_context(userlist $userlist) {
        $context = $userlist->get_context();

        if ($context->contextlevel != CONTEXT_COURSE) {
            return;
        }

        $sql = "SELECT userid FROM {enrol_flatfile} WHERE courseid = ?";
        $params = [$context->instanceid];
        $userlist->add_from_sql('userid', $sql, $params);
    }
1183422
public void setUserGroup(String userGroup) {

        CmsGroup group = checkGroup(userGroup);
        if (group != null) {
            m_project.setGroupId(group.getId());
        }
    }
847279
public static function delete_data_for_users(approved_userlist $userlist) {
        $context = $userlist->get_context();

        if (!in_array($context->instanceid, $userlist->get_userids())) {
            return;
        }

        if ($context->contextlevel == CONTEXT_USER) {
            // We can only delete our own data in the user context, nothing in course or system.
            static::delete_user_data($context->instanceid);
        }
    }
1326590
public static function delete_data_for_users(approved_userlist $userlist) {
        $context = $userlist->get_context();

        if (!$context instanceof \context_user) {
            return;
        }

        // Remove invalid users. If it ends up empty then early return.
        $userids = array_filter($userlist->get_userids(), function($userid) use($context) {
            return $context->instanceid == $userid;
        });

        if (empty($userids)) {
            return;
        }

        static::delete_user_data($context->instanceid);
    }
1352657
public static function delete_data_for_users(approved_userlist $userlist) {
        $context = $userlist->get_context();

        if ($context instanceof \context_block && ($blockinstance = static::get_instance_from_context($context))) {
            blocks_delete_instance($blockinstance);
        }
    }
288099
public static function get_users_in_context(userlist $userlist) {
        $context = $userlist->get_context();

        if (!$context instanceof \context_module) {
            return;
        }

        $params = [
            'cmid'    => $context->instanceid,
            'modname' => 'quiz',
        ];

        // Users who attempted the quiz.
        $sql = "SELECT qa.userid
                  FROM {course_modules} cm
                  JOIN {modules} m ON m.id = cm.module AND m.name = :modname
                  JOIN {quiz} q ON q.id = cm.instance
                  JOIN {quiz_attempts} qa ON qa.quiz = q.id
                 WHERE cm.id = :cmid AND qa.preview = 0";
        $userlist->add_from_sql('userid', $sql, $params);

        // Users with quiz overrides.
        $sql = "SELECT qo.userid
                  FROM {course_modules} cm
                  JOIN {modules} m ON m.id = cm.module AND m.name = :modname
                  JOIN {quiz} q ON q.id = cm.instance
                  JOIN {quiz_overrides} qo ON qo.quiz = q.id
                 WHERE cm.id = :cmid";
        $userlist->add_from_sql('userid', $sql, $params);

        // Question usages in context.
        // This includes where a user is the manual marker on a question attempt.
        $sql = "SELECT qa.uniqueid
                  FROM {course_modules} cm
                  JOIN {modules} m ON m.id = cm.module AND m.name = :modname
                  JOIN {quiz} q ON q.id = cm.instance
                  JOIN {quiz_attempts} qa ON qa.quiz = q.id
                 WHERE cm.id = :cmid AND qa.preview = 0";
        \core_question\privacy\provider::get_users_in_context_from_sql($userlist, 'qn', $sql, $params);
    }
579732
public static function get_users_in_context(userlist $userlist) {
        global $DB;

        $context = $userlist->get_context();

        if (!is_a($context, \context_user::class)) {
            return;
        }

        // Add user if any messagelist data exists.
        if ($DB->record_exists('messageinbound_messagelist', ['userid' => $context->instanceid])) {
            // Only using user context, so instance ID will be the only user ID.
            $userlist->add_user($context->instanceid);
        }

        // Add users based on userkey (since we also delete those).
        \core_userkey\privacy\provider::get_user_contexts_with_script($userlist, $context, 'messageinbound_handler');
    }
1188868
public void setUserActivities(java.util.Collection<Activity> userActivities) {
        if (userActivities == null) {
            this.userActivities = null;
            return;
        }

        this.userActivities = new java.util.ArrayList<Activity>(userActivities);
    }
279973
public void setSAMLProviderList(java.util.Collection<SAMLProviderListEntry> sAMLProviderList) {
        if (sAMLProviderList == null) {
            this.sAMLProviderList = null;
            return;
        }

        this.sAMLProviderList = new com.amazonaws.internal.SdkInternalList<SAMLProviderListEntry>(sAMLProviderList);
    }
1125649
public void setUsers(java.util.Collection<UserData> users) {
        if (users == null) {
            this.users = null;
            return;
        }

        this.users = new java.util.ArrayList<UserData>(users);
    }
586355
public static function get_userids_from_context(\core_privacy\local\request\userlist $userlist) {
        $context = $userlist->get_context();
        if ($context->contextlevel != CONTEXT_MODULE) {
            return;
        }
        comments_provider::get_users_in_context_from_sql($userlist, 'c', 'assignsubmission_comments', 'submission_comments',
                $context->id);
    }
938182
public static function get_users_in_context(userlist $userlist) {
        $context = $userlist->get_context();
        $params = ['contextid' => $context->id];

        // Add users who have modified the frameworks and related data in the context.
        $sql = "
             SELECT cf.usermodified
               FROM {" . competency_framework::TABLE . "} cf
              WHERE cf.contextid = :contextid";
        $userlist->add_from_sql('usermodified', $sql, $params);

        $sql = "
             SELECT c.usermodified
               FROM {" . competency_framework::TABLE . "} cf
               JOIN {" . competency::TABLE . "} c
                 ON c.competencyframeworkid = cf.id
              WHERE cf.contextid = :contextid";
        $userlist->add_from_sql('usermodified', $sql, $params);

        $sql = "
             SELECT cr.usermodified
               FROM {" . competency_framework::TABLE . "} cf
               JOIN {" . competency::TABLE . "} c
                 ON c.competencyframeworkid = cf.id
               JOIN {" . related_competency::TABLE . "} cr
                 ON cr.competencyid = c.id
              WHERE cf.contextid = :contextid";
        $userlist->add_from_sql('usermodified', $sql, $params);

        // Add users who have modified the templates and related data in the context.
        $sql = "
             SELECT tpl.usermodified
               FROM {" . template::TABLE . "} tpl
              WHERE tpl.contextid = :contextid";
        $userlist->add_from_sql('usermodified', $sql, $params);

        $sql = "
             SELECT tch.usermodified
               FROM {" . template::TABLE . "} tpl
               JOIN {" . template_cohort::TABLE . "} tch
                 ON tch.templateid = tpl.id
              WHERE tpl.contextid = :contextid";
        $userlist->add_from_sql('usermodified', $sql, $params);

        $sql = "
             SELECT tc.usermodified
               FROM {" . template::TABLE . "} tpl
               JOIN {" . template_competency::TABLE . "} tc
                 ON tc.templateid = tpl.id
              WHERE tpl.contextid = :contextid";
        $userlist->add_from_sql('usermodified', $sql, $params);

        // Add users if userlist is in course context.
        if (is_a($context, \context_course::class)) {
            $params = ['courseid' => $context->instanceid];

            $sql = "
                 SELECT cc.usermodified
                   FROM {" . course_competency::TABLE . "} cc
                  WHERE cc.courseid = :courseid";
            $userlist->add_from_sql('usermodified', $sql, $params);

            $sql = "
                 SELECT ccs.usermodified
                   FROM {" . course_competency_settings::TABLE . "} ccs
                  WHERE ccs.courseid = :courseid";
            $userlist->add_from_sql('usermodified', $sql, $params);

            $sql = "
                 SELECT ucc.userid, ucc.usermodified
                   FROM {" . user_competency_course::TABLE . "} ucc
                  WHERE ucc.courseid = :courseid";
            $userlist->add_from_sql('userid', $sql, $params);
            $userlist->add_from_sql('usermodified', $sql, $params);

        } else if (is_a($context, \context_module::class)) {
            // Add users if userlist is in module context.
            $params = ['moduleid' => $context->instanceid];

            $sql = "
                 SELECT cmc.usermodified
                   FROM {" . course_module_competency::TABLE . "} cmc
                  WHERE cmc.cmid = :moduleid";
            $userlist->add_from_sql('usermodified', $sql, $params);

        } else if (is_a($context, \context_user::class)) {
            $params = ['userid' => $context->instanceid];

            // Add users through plan related data.
            $sql = "
                 SELECT p.userid, p.usermodified, p.reviewerid
                   FROM {" . plan::TABLE . "} p
                  WHERE p.userid = :userid";
            $userlist->add_from_sql('userid', $sql, $params);
            $userlist->add_from_sql('usermodified', $sql, $params);
            $userlist->add_from_sql('reviewerid', $sql, $params);

            $sql = "
                 SELECT pc.usermodified
                   FROM {" . plan::TABLE . "} p
                   JOIN {" . plan_competency::TABLE . "} pc
                     ON pc.planid = p.id
                  WHERE p.userid = :userid";
            $userlist->add_from_sql('usermodified', $sql, $params);

            $sql = "
                 SELECT upc.usermodified
                   FROM {" . user_competency_plan::TABLE . "} upc
                  WHERE upc.userid = :userid";
            $userlist->add_from_sql('usermodified', $sql, $params);

            // Add users through competency data.
            $sql = "
                 SELECT uc.userid, uc.usermodified, uc.reviewerid
                   FROM {" . user_competency::TABLE . "} uc
                  WHERE uc.userid = :userid";
            $userlist->add_from_sql('userid', $sql, $params);
            $userlist->add_from_sql('usermodified', $sql, $params);
            $userlist->add_from_sql('reviewerid', $sql, $params);

            $sql = "
                 SELECT e.usermodified, e.actionuserid
                   FROM {" . user_competency::TABLE . "} uc
                   JOIN {" . evidence::TABLE . "} e
                     ON e.usercompetencyid = uc.id
                  WHERE uc.userid = :userid";
            $userlist->add_from_sql('usermodified', $sql, $params);
            $userlist->add_from_sql('actionuserid', $sql, $params);

            // Add users through evidence data.
            $sql = "
                 SELECT ue.userid, ue.usermodified
                   FROM {" . user_evidence::TABLE . "} ue
                  WHERE ue.userid = :userid";
            $userlist->add_from_sql('userid', $sql, $params);
            $userlist->add_from_sql('usermodified', $sql, $params);

            $sql = "
                 SELECT ue.usermodified
                   FROM {" . user_evidence::TABLE . "} ue
                   JOIN {" . user_evidence_competency::TABLE . "} uec
                     ON uec.userevidenceid = ue.id
                  WHERE ue.userid = :userid";
            $userlist->add_from_sql('usermodified', $sql, $params);
        }

        // Add users who commented in the context.
        // Note: Comment component must be competency and not core_competency.
        \core_comment\privacy\provider::get_users_in_context_from_sql(
                $userlist, 'com', 'competency', 'plan', $context->id);

        \core_comment\privacy\provider::get_users_in_context_from_sql(
                $userlist, 'com', 'competency', 'user_competency', $context->id);
    }
1031196
public static function get_users_in_context(\core_privacy\local\request\userlist $userlist) {
        $context = $userlist->get_context();
        if ($context->contextlevel != CONTEXT_MODULE) {
            return;
        }

        $params = ['contextid' => $context->id];

        $sql = "SELECT d.usercreated, d.usermodified
                  FROM {grading_definitions} d
                  JOIN {grading_areas} a ON a.id = d.areaid
                  WHERE a.contextid = :contextid";
        $userlist->add_from_sql('usercreated', $sql, $params);
        $userlist->add_from_sql('usermodified', $sql, $params);

        $sql = "SELECT i.raterid
                  FROM {grading_definitions} d
                  JOIN {grading_areas} a ON a.id = d.areaid
                  JOIN {grading_instances} i ON i.definitionid = d.id
                  WHERE a.contextid = :contextid";
        $userlist->add_from_sql('raterid', $sql, $params);
    }