Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
core_xapi\iri Class Reference

Class to translate Moodle objects to xAPI elements. More...

Static Public Member Functions

static check (string $value)
 Check if a $value could be a valid IRI or not.
 
static extract (string $value, string $type=null)
 Try to extract the original value from an IRI.
 
static generate (string $value, string $type=null)
 Generate a valid IRI element from a $value and an optional $type.
 

Detailed Description

Class to translate Moodle objects to xAPI elements.

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

Member Function Documentation

◆ check()

static core_xapi\iri::check ( string $value)
static

Check if a $value could be a valid IRI or not.

Parameters
string$valuethe currewnt IRI value.
Return values
boolif 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$valuethe currewnt IRI value.
string | null$typeif $value is a fake IRI, the $type must be provided.
Return values
stringthe original value used in iri\generate.

◆ 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$valuea valid IRI value or any string
string | null$typeif none passed $type will be 'element'
Return values
stringa valid IRI value

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