Verb xAPI statement item.
More...
|
| __construct (stdClass $data) |
| An xAPI verb constructor based on xAPI data structure. More...
|
|
|
stdClass | $data |
| the item structure.
|
|
string | $id |
| The statement.
|
|
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.
- Copyright
- 2020 Ferran Recio
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
core_xapi\local\statement\item_verb::__construct |
( |
stdClass |
$data | ) |
|
|
protected |
An xAPI verb constructor based on xAPI data structure.
- Parameters
-
stdClass | $data | from the specific xAPI element |
Reimplemented from core_xapi\local\statement\item.
◆ 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 | $data | the original xAPI element |
- Return values
-
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 | $id | string to convert to a valid IRI (or a valid IRI) |
- Return values
-
◆ get_data()
core_xapi\local\statement\item::get_data |
( |
| ) |
|
|
inherited |
Return the original data from this item.
- Return values
-
stdClass | the 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
-
string | the 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
-
stdClass | the original data structure |
The documentation for this class was generated from the following file: