27 protected $_sClassRow;
32 private static $_tInstance=array();
39 if ( !isset(self::$_tInstance[$class][$sConfig]) ){
40 $oSgbd =
new $class();
41 $oSgbd->chooseConfig($sConfig);
42 self::$_tInstance[$class][$sConfig]=$oSgbd;
45 return self::$_tInstance[$class][$sConfig];
54 $this->_sClassRow=$sClassRow;
61 $this->_sConfig=$sConfig;
68 $this->_tConfig=$tConfig;
80 public function bind($tReq){
85 if(isset($tReq[1]) and is_array($tReq[1])){
89 $tParam=array_values($tReq);
92 foreach($tParam as $sVal){
93 $sVal=$this->quote($sVal);
94 $sReq=preg_replace(
'/[?]/',$sVal,$sReq,1);
103 public function getInsertFromTab($tProperty){
109 foreach($tProperty as $sVar => $sVal){
111 $sVals.=$this->quote($sVal).
',';
114 return '('.substr($sCols,0,-1).
') VALUES ('.substr($sVals,0,-1).
') ';
116 public function getUpdateFromTab($tProperty){
119 foreach($tProperty as $sVar => $sVal){
120 $sReq.=$sVar.
'='.$this->quote($sVal).
',';
123 return substr($sReq,0,-1);
125 public function setId($tId){
128 public function getWhereFromTab($tId){
131 foreach($tId as $sVar => $sVal){
132 if($sWhere!=
''){ $sWhere.=
' AND '; }
133 $sWhere.=$sVar.
'='.$this->quote($sVal);
139 public function erreur($sErreur){
140 throw new Exception($sErreur);
static _getInstance($class, $sConfig)