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\contextlist_base Class Reference

Base implementation of a contextlist used to store a set of contexts. More...

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

Public Member Functions

 count ()
 Return the number of contexts.
 
 current ()
 Return the current context. More...
 
 get_component ()
 Get the name of the component to which this contextlist belongs. More...
 
 get_contextids ()
 Get the list of context IDs that relate to this request. More...
 
 get_contexts ()
 Get the complete list of context objects that relate to this request. More...
 
 key ()
 Return the key of the current element. More...
 
 next ()
 Move to the next context in the list.
 
 rewind ()
 Rewind to the first found context. More...
 
 valid ()
 Check if the current position is valid. More...
 

Protected Member Functions

 set_component ($component)
 Sets the component for this contextlist. More...
 
 set_contextids (array $contextids)
 Set the contextids. More...
 

Protected Attributes

string $component = ''
 component the frankenstyle component name.
 
int $iteratorposition = 0
 Current position of the iterator.
 

Detailed Description

Base implementation of a contextlist used to store a set of contexts.

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

Member Function Documentation

◆ current()

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

Return the current context.

Return values
context

◆ get_component()

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

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

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

Return values
int[]

◆ get_contexts()

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

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

Return values
context[]

◆ key()

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

Return the key of the current element.

Return values
mixed

◆ rewind()

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

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)
protected

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)
protected

Set the contextids.

Parameters
array$contextidsThe list of contexts.

◆ valid()

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

Check if the current position is valid.

Return values
bool

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