Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
core_xapi\local\statement\item_group Class Reference

Group item inside a xAPI statement. More...

Inheritance diagram for core_xapi\local\statement\item_group:
core_xapi\local\statement\item_actor core_xapi\local\statement\item_object core_xapi\local\statement\item

Public Member Functions

 get_all_users ()
 Return all users from the group represented by this item. More...
 
 get_data ()
 Return the original data from this item. More...
 
 get_group ()
 Return the moodle group represented by this item. More...
 
 get_user ()
 Returns the moodle user represented by this item. More...
 
 jsonSerialize ()
 Return the data to serialize in case JSON statement is needed. More...
 

Static Public Member Functions

static create_from_data (stdClass $data)
 Function to create an item from part of the xAPI statement. More...
 
static create_from_group (stdClass $group)
 Create a item_group from a existing group. More...
 

Protected Member Functions

 __construct (stdClass $data, stdClass $group)
 Function to create an group from part of the xAPI statement. More...
 

Protected Attributes

stdClass $data
 the item structure.
 
timestamp $group
 The statement timestamp.
 
timestamp $users
 The statement timestamp.
 

Detailed Description

Group item inside a xAPI statement.

Only named groups are accepted (all groups must be real groups in the platform) so anonymous groups will be rejected on creation. Groups can be used as actor or as object inside a xAPI statement.

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

Constructor & Destructor Documentation

◆ __construct()

core_xapi\local\statement\item_group::__construct ( stdClass  $data,
stdClass  $group 
)
protected

Function to create an group from part of the xAPI statement.

Parameters
stdClass$datathe original xAPI element
stdClass$groupgroup record

Member Function Documentation

◆ create_from_data()

static core_xapi\local\statement\item_group::create_from_data ( stdClass  $data)
static

Function to create an item from part of the xAPI statement.

Parameters
stdClass$datathe original xAPI element
Return values
itemitem_group xAPI item generated

Reimplemented from core_xapi\local\statement\item_actor.

◆ create_from_group()

static core_xapi\local\statement\item_group::create_from_group ( stdClass  $group)
static

Create a item_group from a existing group.

Parameters
stdClass$groupA group record.
Return values
item_group

◆ get_all_users()

core_xapi\local\statement\item_group::get_all_users ( )

Return all users from the group represented by this item.

Return values
arraygroup users

Reimplemented from core_xapi\local\statement\item_actor.

◆ get_data()

core_xapi\local\statement\item::get_data ( )
inherited

Return the original data from this item.

Return values
stdClassthe original data structure

◆ get_group()

core_xapi\local\statement\item_group::get_group ( )

Return the moodle group represented by this item.

Return values
stdClassa group record

◆ get_user()

core_xapi\local\statement\item_group::get_user ( )

Returns the moodle user represented by this item.

This is a group item. To avoid security problems this method thorws an exception when is called from a item_group class.

Exceptions
xapi_exceptionget_user must not be called from an item_group
Return values
stdClassuser record

Reimplemented from core_xapi\local\statement\item_actor.

◆ jsonSerialize()

core_xapi\local\statement\item::jsonSerialize ( )
inherited

Return the data to serialize in case JSON statement is needed.

Return values
stdClassthe original data structure

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