InstanceRecord.php
Go to the documentation of this file.
00001 <?php 00002 00005 00026 class InstanceRecord 00027 { 00029 public $id; 00030 00032 public $attributes = array(); 00033 00034 function __construct() { } 00035 00036 function __destruct() { } 00037 00048 public function setId($id) 00049 { 00050 if($id != "") 00051 { 00052 $this->id = array( $id ); 00053 00054 $this->id["valueType"] = "primitive:id[1]"; 00055 } 00056 } 00057 00070 public function setAttribute($attr, $value, $valueType) 00071 { 00072 if($value != "") 00073 { 00074 if(!is_array($this->attributes[$attr])) 00075 { 00076 $this->attributes[$attr] = array( $value ); 00077 } 00078 else 00079 { 00080 array_push($this->attributes[$attr], $value); 00081 } 00082 00083 $this->attributes[$attr]["valueType"] = $valueType; 00084 } 00085 } 00086 00100 public function setAttributeRef($attr, $metaData, $ref, $valueType) 00101 { $this->addRef($this->attributes[$attr], $metaData, $ref, $valueType); } 00102 00116 private function addRef(&$attr, $metaData, $ref, $valueType) 00117 { 00118 if(!is_array($attr)) 00119 { 00120 $attr = array( array ("metaData" => $metaData, "ref" => $ref) ); 00121 } 00122 else 00123 { 00124 array_push($attr, array ("metaData" => $metaData, "ref" => $ref)); 00125 } 00126 00127 $attr["valueType"] = $valueType; 00128 } 00129 00140 public function getValueType($property) 00141 { 00142 if(isset($this->{$property}["valueType"])) 00143 { 00144 return ($this->{$property}["valueType"]); 00145 } 00146 else 00147 { 00148 // Check if it is part of "attributes" 00149 if(isset($this->{"attributes"}[$property]["valueType"])) 00150 { 00151 return ($this->{"attributes"}[$property]["valueType"]); 00152 } 00153 00154 return (FALSE); 00155 } 00156 } 00157 } 00158 00160 00161 ?>
