Register an RDF datatype with a PHP class name
When parsing registered class will be used whenever the datatype is seen.
When serialising a registered class, the mapping will be used to set the datatype in the RDF.
Example: EasyRdf_Literal::registerDatatype('xsd:dateTime', 'My_DateTime_Class');
string $datatype The RDF datatype (e.g. xsd:dateTime):
string $class The PHP class name (e.g. My_DateTime_Class):
public static function setDatatypeMapping($datatype, $class) {
if (!is_string($datatype) or $datatype == null or $datatype == '') {
throw new InvalidArgumentException("\$datatype should be a string and cannot be null or empty");
}
if (!is_string($class) or $class == null or $class == '') {
throw new InvalidArgumentException("\$class should be a string and cannot be null or empty");
}
$datatype = EasyRdf_Namespace::expand($datatype);
self::$datatypeMap[$datatype] = $class;
self::$classMap[$class] = $datatype;
}