Xataface  2.0alpha2
Xataface Application Framework
 All Data Structures Namespaces Files Functions Variables Groups Pages
ImportRecord.php
Go to the documentation of this file.
1 <?php
2 
12 
18  var $classpath = null;
19 
24  var $values = array();
25 
41  $this->classpath = $classpath;
42  $this->load($data);
43  }
44 
45 
50  function toArray(){
51  return array_merge(
52  $this->getValues(),
53  array(
54  '__CLASS__'=>get_class($this),
55  '__CLASSPATH__'=>$this->getClassPath()
56  )
57  );
58  }
59 
63  function load($data){
64  if ( is_array($data) ){
65  $this->values = $data;
66  }
67  unset($this->values['__CLASS__']);
68  unset($this->values['__CLASSPATH__']);
69  }
70 
71  function getValues(){
72  return $this->values;
73  }
74 
78  function setValue($key, $value){
79  $this->values[$key] = $value;
80  }
81 
82 
86  function getValue($key){
87  return $this->values[$key];
88  }
89  function val($key){ return $this->getValue($key);}
90 
91 
95  function commit(){
96  return PEAR::raiseError("Method ".__FUNCTION__." is not implemented. It should be implemented in a subclass.");
97  }
98 
99  function getClassPath(){
100  return $this->classpath;
101  }
102 }