Dataset.php
Go to the documentation of this file.
00001 <?php 00002 00005 00026 class Dataset 00027 { 00029 public $id; 00030 00032 public $linkageSchema; 00033 00035 public $structureSchema; 00036 00038 public $attributes; 00039 00040 function __construct() { } 00041 00042 function __destruct() { } 00043 00054 public function setId($id) 00055 { 00056 if($id != "") 00057 { 00058 $this->id = array( $id ); 00059 00060 $this->id["valueType"] = "primitive:id[1]"; 00061 } 00062 } 00063 00074 public function setLinkageSchema($linkageSchema) 00075 { 00076 if($linkageSchema != "") 00077 { 00078 $this->linkageSchema = array( $linkageSchema ); 00079 00080 $this->linkageSchema["valueType"] = "primitive:string[1]"; 00081 } 00082 } 00083 00094 public function setStructureSchema($structureSchema) 00095 { 00096 if($structureSchema != "") 00097 { 00098 $this->structureSchema = array( $structureSchema ); 00099 00100 $this->structureSchema["valueType"] = "primitive:string[1]"; 00101 } 00102 } 00103 00116 public function setAttribute($attr, $value, $valueType) 00117 { 00118 if($value != "") 00119 { 00120 if(!is_array($this->attributes[$attr])) 00121 { 00122 $this->attributes[$attr] = array( $value ); 00123 } 00124 else 00125 { 00126 array_push($this->attributes[$attr], $value); 00127 } 00128 00129 $this->attributes[$attr]["valueType"] = $valueType; 00130 } 00131 } 00132 00146 public function setAttributeRef($attr, $metaData, $ref, $valueType) 00147 { $this->addRef($this->attributes[$attr], $metaData, $ref, $valueType); } 00148 00162 private function addRef(&$attr, $metaData, $ref, $valueType) 00163 { 00164 if(!is_array($attr)) 00165 { 00166 $attr = array( array ("metaData" => $metaData, "ref" => $ref) ); 00167 } 00168 else 00169 { 00170 array_push($attr, array ("metaData" => $metaData, "ref" => $ref)); 00171 } 00172 00173 $attr["valueType"] = $valueType; 00174 } 00175 00186 public function getValueType($property) 00187 { 00188 if(isset($this->{$property}["valueType"])) 00189 { 00190 return ($this->{$property}["valueType"]); 00191 } 00192 else 00193 { 00194 // Check if it is part of "attributes" 00195 if(isset($this->{"attributes"}[$property]["valueType"])) 00196 { 00197 return ($this->{"attributes"}[$property]["valueType"]); 00198 } 00199 00200 return (FALSE); 00201 } 00202 } 00203 } 00204 00206 00207 ?>
