xAPI LRS IRI values generator.
Copyright: | 2020 Ferran Recio |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 93 lines (3 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
generate(string $value, string $type = null) X-Ref |
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. return: string a valid IRI value param: string $value a valid IRI value or any string param: string|null $type if none passed $type will be 'element' |
extract(string $value, string $type = null) X-Ref |
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. return: string the original value used in iri::generate. param: string $value the currewnt IRI value. param: string|null $type if $value is a fake IRI, the $type must be provided. |
check(string $value) X-Ref |
Check if a $value could be a valid IRI or not. return: bool if the $value could be an IRI. param: string $value the currewnt IRI value. |