Class to translate Moodle objects to xAPI elements.
More...
|
static | check (string $value) |
| Check if a $value could be a valid IRI or not. More...
|
|
static | extract (string $value, string $type=null) |
| Try to extract the original value from an IRI. More...
|
|
static | generate (string $value, string $type=null) |
| Generate a valid IRI element from a $value and an optional $type. More...
|
|
Class to translate Moodle objects to xAPI elements.
- Copyright
- 2020 Ferran Recio
- Since
- Moodle 3.9
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ check()
static core_xapi\iri::check |
( |
string |
$value | ) |
|
|
static |
Check if a $value could be a valid IRI or not.
- Parameters
-
string | $value | the currewnt IRI value. |
- Return values
-
bool | if the $value could be an IRI. |
◆ extract()
static core_xapi\iri::extract |
( |
string |
$value, |
|
|
string |
$type = null |
|
) |
| |
|
static |
Try to extract the original value from an IRI.
If a real IRI value is passed, it will return it without any change. If a fake IRI is passed (generated by iri::generate) it will try to extract the original value.
- Parameters
-
string | $value | the currewnt IRI value. |
string | null | $type | if $value is a fake IRI, the $type must be provided. |
- Return values
-
◆ generate()
static core_xapi\iri::generate |
( |
string |
$value, |
|
|
string |
$type = null |
|
) |
| |
|
static |
Generate a valid IRI element from a $value and an optional $type.
Verbs and Objects in xAPI are in IRI format. This function could get a valid IRI value (and will return without modifiyng it) or a simple string and a type and generate a fake IRI valir for any xAPI statement.
- Parameters
-
string | $value | a valid IRI value or any string |
string | null | $type | if none passed $type will be 'element' |
- Return values
-
The documentation for this class was generated from the following file: