![]() |
Xataface 2.0
Xataface Application Framework
|
00001 <?php 00002 00011 class Dataface_ImportRecord { 00012 00018 var $classpath = null; 00019 00024 var $values = array(); 00025 00040 function Dataface_ImportRecord($classpath, $data){ 00041 $this->classpath = $classpath; 00042 $this->load($data); 00043 } 00044 00045 00050 function toArray(){ 00051 return array_merge( 00052 $this->getValues(), 00053 array( 00054 '__CLASS__'=>get_class($this), 00055 '__CLASSPATH__'=>$this->getClassPath() 00056 ) 00057 ); 00058 } 00059 00063 function load($data){ 00064 if ( is_array($data) ){ 00065 $this->values = $data; 00066 } 00067 unset($this->values['__CLASS__']); 00068 unset($this->values['__CLASSPATH__']); 00069 } 00070 00071 function getValues(){ 00072 return $this->values; 00073 } 00074 00078 function setValue($key, $value){ 00079 $this->values[$key] = $value; 00080 } 00081 00082 00086 function getValue($key){ 00087 return $this->values[$key]; 00088 } 00089 function val($key){ return $this->getValue($key);} 00090 00091 00095 function commit(){ 00096 return PEAR::raiseError("Method ".__FUNCTION__." is not implemented. It should be implemented in a subclass."); 00097 } 00098 00099 function getClassPath(){ 00100 return $this->classpath; 00101 } 00102 }