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_verb Class Reference

Verb xAPI statement item. More...

Inheritance diagram for core_xapi\local\statement\item_verb:
core_xapi\local\statement\item

Public Member Functions

 get_data ()
 Return the original data from this item. More...
 
 get_id ()
 Return the id used in 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_id (string $id)
 Create a valid item_verb from a simple verb string. More...
 

Protected Member Functions

 __construct (stdClass $data)
 An xAPI verb constructor based on xAPI data structure. More...
 

Protected Attributes

stdClass $data
 the item structure.
 
string $id
 The statement.
 

Detailed Description

Verb xAPI statement item.

Verbs represent the interaction a user/group made inside a xAPI compatible plugin. Internally a xAPI verb must be representad as in a valid IRI format (which is a less restrictive version of a regular URL so a moodle_url out is completelly fine). To make it easy for plugins to generate valid IRI, a simple string van be provided and the class will convert into a valid IRI internally.

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

Constructor & Destructor Documentation

◆ __construct()

core_xapi\local\statement\item_verb::__construct ( stdClass  $data)
protected

An xAPI verb constructor based on xAPI data structure.

Parameters
stdClass$datafrom the specific xAPI element

Reimplemented from core_xapi\local\statement\item.

Member Function Documentation

◆ create_from_data()

static core_xapi\local\statement\item_verb::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_verb xAPI generated

Reimplemented from core_xapi\local\statement\item.

◆ create_from_id()

static core_xapi\local\statement\item_verb::create_from_id ( string  $id)
static

Create a valid item_verb from a simple verb string.

Parameters
string$idstring to convert to a valid IRI (or a valid IRI)
Return values
item_verbthe resulting item_verb

◆ get_data()

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

Return the original data from this item.

Return values
stdClassthe original data structure

◆ get_id()

core_xapi\local\statement\item_verb::get_id ( )

Return the id used in this item.

Id will be extracted from the provided IRI. If it's a valid IRI it will return all IRI value but if it is generate by the iri helper from this library it will extract the original value.

Return values
stringthe ID (extracted from IRI value)

◆ 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: