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

An implementation of a contextlist which has been filtered and approved. More...

Inheritance diagram for core_privacy\local\request\approved_contextlist:
core_privacy\local\request\contextlist_base core_privacy\tests\request\approved_contextlist

Public Member Functions

 __construct (\stdClass $user, string $component, array $contextids)
 Create a new approved contextlist.
 
 count ()
 Return the number of contexts.
 
 current ()
 Return the current context.
 
 get_component ()
 Get the name of the component to which this contextlist belongs.
 
 get_contextids ()
 Get the list of context IDs that relate to this request.
 
 get_contexts ()
 Get the complete list of context objects that relate to this request.
 
 get_user ()
 Get the user which requested their data.
 
 key ()
 Return the key of the current element.
 
 next ()
 Move to the next context in the list.
 
 rewind ()
 Rewind to the first found context.
 
 valid ()
 Check if the current position is valid.
 

Protected Member Functions

 set_component ($component)
 Sets the component for this contextlist.
 
 set_contextids (array $contextids)
 Set the contextids.
 
 set_user (\stdClass $user)
 Specify the user which owns this request.
 

Protected Attributes

string $component = ''
 component the frankenstyle component name.
 
int $iteratorposition = 0
 Current position of the iterator.
 
stdClass $user
 The user this contextlist belongs to.
 

Detailed Description

An implementation of a contextlist which has been filtered and approved.

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

Constructor & Destructor Documentation

◆ __construct()

core_privacy\local\request\approved_contextlist::__construct ( \stdClass $user,
string $component,
array $contextids )

Create a new approved contextlist.

Parameters
stdClass$userThe user record.
string$componentthe frankenstyle component name.
int[]$contextidsThe list of contextids present in this list.

Member Function Documentation

◆ current()

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

Return the current context.

Return values
context

◆ get_component()

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

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

Return values
stringthe component name associated with this contextlist.

◆ get_contextids()

core_privacy\local\request\contextlist_base::get_contextids ( )
inherited

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

Return values
int[]

◆ get_contexts()

core_privacy\local\request\contextlist_base::get_contexts ( )
inherited

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

Return values
context[]

◆ get_user()

core_privacy\local\request\approved_contextlist::get_user ( )

Get the user which requested their data.

Return values
stdClass

◆ key()

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

Return the key of the current element.

Return values
mixed

◆ rewind()

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

Rewind to the first found context.

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

◆ set_component()

core_privacy\local\request\contextlist_base::set_component ( $component)
protectedinherited

Sets the component for this contextlist.

Parameters
string$componentthe frankenstyle component name.

Reimplemented in core_privacy\local\request\contextlist.

◆ set_contextids()

core_privacy\local\request\contextlist_base::set_contextids ( array $contextids)
protectedinherited

Set the contextids.

Parameters
array$contextidsThe list of contexts.

◆ set_user()

core_privacy\local\request\approved_contextlist::set_user ( \stdClass $user)
protected

Specify the user which owns this request.

Parameters
stdClass$userThe user record.
Return values
$this

◆ valid()

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

Check if the current position is valid.

Return values
bool

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