Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
core_privacy\local\request\userlist_base Class Reference

Base implementation of a userlist used to store a set of users. More...

Inheritance diagram for core_privacy\local\request\userlist_base:
core_privacy\local\request\approved_userlist core_privacy\local\request\userlist tool_dataprivacy\filtered_userlist

Public Member Functions

 __construct (\context $context, string $component)
 Constructor to create a new userlist. More...
 
 count ()
 Return the number of users.
 
 current ()
 Return the current user. More...
 
 get_component ()
 Get the name of the component to which this userlist belongs. More...
 
 get_context ()
 Get the context for this userlist. More...
 
 get_userids ()
 Get the list of user IDs that relate to this request. More...
 
 get_users ()
 Get the complete list of user objects that relate to this request. More...
 
 key ()
 Return the key of the current element. More...
 
 next ()
 Move to the next user in the list.
 
 rewind ()
 Rewind to the first found user. More...
 
 valid ()
 Check if the current position is valid. More...
 

Protected Member Functions

 add_userids (array $userids)
 Add a set of additional userids. More...
 
 set_component ($component)
 Sets the component for this userlist. More...
 
 set_userids (array $userids)
 Set the userids. More...
 

Protected Attributes

string $component = ''
 component the frankenstyle component name.
 
context $context
 The context that this userlist belongs to.
 
int $iteratorposition = 0
 Current position of the iterator.
 

Detailed Description

Base implementation of a userlist used to store a set of users.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

core_privacy\local\request\userlist_base::__construct ( \context  $context,
string  $component 
)

Constructor to create a new userlist.

Parameters
context$context
string$component

Member Function Documentation

◆ add_userids()

core_privacy\local\request\userlist_base::add_userids ( array  $userids)
protected

Add a set of additional userids.

Parameters
array$useridsThe list of users.
Return values
$this

◆ current()

core_privacy\local\request\userlist_base::current ( )

Return the current user.

Return values
user

◆ get_component()

core_privacy\local\request\userlist_base::get_component ( )

Get the name of the component to which this userlist belongs.

Return values
stringthe component name associated with this userlist.

◆ get_context()

core_privacy\local\request\userlist_base::get_context ( )

Get the context for this userlist.

Return values
context

◆ get_userids()

core_privacy\local\request\userlist_base::get_userids ( )

Get the list of user IDs that relate to this request.

Return values
int[]

◆ get_users()

core_privacy\local\request\userlist_base::get_users ( )

Get the complete list of user objects that relate to this request.

Return values
stdClass[]

◆ key()

core_privacy\local\request\userlist_base::key ( )

Return the key of the current element.

Return values
mixed

◆ rewind()

core_privacy\local\request\userlist_base::rewind ( )

Rewind to the first found user.

The list of users is uniqued during the rewind. The rewind is called at the start of most iterations.

◆ set_component()

core_privacy\local\request\userlist_base::set_component (   $component)
protected

Sets the component for this userlist.

Parameters
string$componentthe frankenstyle component name.
Return values
$this

Reimplemented in core_privacy\local\request\userlist.

◆ set_userids()

core_privacy\local\request\userlist_base::set_userids ( array  $userids)
protected

Set the userids.

Parameters
array$useridsThe list of users.
Return values
$this

◆ valid()

core_privacy\local\request\userlist_base::valid ( )

Check if the current position is valid.

Return values
bool

The documentation for this class was generated from the following file: