25 private $_bChooseUpdate=
false;
26 protected $_tProperty=array();
27 protected $_tPropertyToUpdate;
35 $this->_tProperty=$tRow;
36 $this->chooseUpdate();
45 $sModel=$this->sClassModel;
46 return call_user_func(array($sModel,
'getInstance'));
53 if($this->_bChooseUpdate ==
true){
71 return $this->
getModel()->insert($this);
78 public function delete(){
79 return $this->
getModel()->delete($this);
87 if(empty($this->_tProperty) and empty($this->_tPropertyToUpdate)){
93 public function chooseUpdate(){
94 $this->_bChooseUpdate=
true;
103 if($this->_tPropertyToUpdate){
104 foreach($this->_tPropertyToUpdate as $sVar){
105 $tToUpdate[$sVar]=$this->_tProperty[$sVar];
119 foreach($tId as $sVar){
120 if(isset($this->_tProperty[$sVar])){
121 $tWhereId[$sVar]=(int)$this->_tProperty[$sVar];
132 $this->_tProperty[$sVar]=$sVal;
133 $this->_tPropertyToUpdate[]=$sVar;
139 if(array_key_exists( (
string)$sVar,$this->_tProperty)){
140 return $this->_tProperty[$sVar];
148 return isset($this->_tProperty[$sVar]);
155 unset($this->_tProperty[$sVar]);
162 if($uId == null){
return false; }
163 $tColumnId=$this->
getModel()->getIdTab();
164 $sColumnId=$tColumnId[0];
166 $this->_tProperty[$sColumnId]=$uId;
168 $this->chooseUpdate();
171 public function getId(){
172 return implode(
'::',$this->
getWhere());
175 public function getTab(){
176 return $this->_tProperty;