|
From: <cw...@us...> - 2007-08-13 05:14:28
|
Revision: 497
http://rdfapi-php.svn.sourceforge.net/rdfapi-php/?rev=497&view=rev
Author: cweiske
Date: 2007-08-12 22:14:26 -0700 (Sun, 12 Aug 2007)
Log Message:
-----------
Allow to pass datatype in constructor
Modified Paths:
--------------
trunk/rdfapi-php/api/model/Literal.php
Modified: trunk/rdfapi-php/api/model/Literal.php
===================================================================
--- trunk/rdfapi-php/api/model/Literal.php 2007-08-13 05:09:53 UTC (rev 496)
+++ trunk/rdfapi-php/api/model/Literal.php 2007-08-13 05:14:26 UTC (rev 497)
@@ -44,23 +44,28 @@
/**
* Constructor
*
- * @param string $str label of the literal
- * @param string $language optional language identifier
+ * @param string $str label of the literal
+ * @param string $language optional language identifier
+ * @param string $datatype optional datatype
*
*/
- function Literal($str, $language = NULL) {
- $this->dtype = NULL;
- $this->label = $str;
+ function Literal($str, $language = NULL, $datatype = null)
+ {
+ $this->label = $str;
- if ($language != NULL) {
- $this->lang = $language;
- } else {
- $this->lang = NULL;
- }
+ if ($language != NULL) {
+ $this->lang = $language;
+ } else {
+ $this->lang = NULL;
+ }
+ if ($datatype != null) {
+ $this->dtype = $datatype;
+ } else {
+ $this->dtype = NULL;
+ }
+ }
- }
-
/**
* Returns the string value of the literal.
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|