Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
core_privacy\local\request\userlist Class Reference

List of users from the Privacy API Search functions. More...

Inheritance diagram for core_privacy\local\request\userlist:
core_privacy\local\request\userlist_base

Public Member Functions

 add_from_sql (string $fieldname, string $sql, array $params)
 Add a set of users from SQL.
 
 add_user (int $userid)
 Adds the user user for a given user.
 
 add_users (array $userids)
 Adds the user users for given users.
 
 count ()
 Return the number of users.
 
 current ()
 Return the current user.
 
 get_component ()
 Get the name of the component to which this userlist belongs.
 
 get_context ()
 Get the context for this userlist.
 
 get_userids ()
 Get the list of user IDs that relate to this request.
 
 get_users ()
 Get the complete list of user objects that relate to this request.
 
 key ()
 Return the key of the current element.
 
 next ()
 Move to the next user in the list.
 
 rewind ()
 Rewind to the first found user.
 
 set_component ($component)
 Sets the component for this userlist.
 
 valid ()
 Check if the current position is valid.
 

Protected Member Functions

 add_userids (array $userids)
 Add a set of additional userids.
 
 set_userids (array $userids)
 Set the userids.
 

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

List of users from the Privacy API Search functions.

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

Member Function Documentation

◆ add_from_sql()

core_privacy\local\request\userlist::add_from_sql ( string $fieldname,
string $sql,
array $params )

Add a set of users from SQL.

The SQL should only return a list of user IDs.

Parameters
string$fieldnameThe name of the field which holds the user id
string$sqlThe SQL which will fetch the list of * user IDs
array$paramsThe set of SQL parameters
Return values
$this

◆ add_user()

core_privacy\local\request\userlist::add_user ( int $userid)

Adds the user user for a given user.

Parameters
int$userid
Return values
$this

◆ add_userids()

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

Add a set of additional userids.

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

◆ add_users()

core_privacy\local\request\userlist::add_users ( array $userids)

Adds the user users for given users.

Parameters
int[]$userids
Return values
$this

◆ current()

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

Return the current user.

Return values
user

◆ get_component()

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

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 ( )
inherited

Get the context for this userlist.

Return values
context

◆ get_userids()

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

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

Return values
int[]

◆ get_users()

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

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

Return values
stdClass[]

◆ key()

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

Return the key of the current element.

Return values
mixed

◆ rewind()

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

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::set_component ( $component)

Sets the component for this userlist.

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

Reimplemented from core_privacy\local\request\userlist_base.

◆ set_userids()

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

Set the userids.

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

◆ valid()

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

Check if the current position is valid.

Return values
bool

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