示例#1
0
 /**
  *
  * @param string $table_name
  */
 public function __construct($table_name)
 {
     parent::__construct(Ibe_Database_Query::UPDATE);
     $this->table = $table_name;
 }
示例#2
0
 /**
  * captura um objeto where
  * @param mixed $fields
  * @param mixed $values
  * @return Ibe_Database_Query_Condition_Where
  */
 private function getWhere($fields, $values)
 {
     // Montando a opcao de campos para arrays ou string unica
     if (!is_array($fields) && !is_array($values) && isset($fields) && isset($values)) {
         $fd = $fields;
         //bug fixed
         $fields = array($fields => '=');
         // Ibe_Debug::warn(__FILE__,$fields);
         $values = array($fd => array($values, 'AND'));
         // Ibe_Debug::warn(__FILE__,$values);
     } else {
         if (!is_array($fields) || !is_array($values)) {
             $fields = array();
         }
     }
     //Clausura where
     $where = Ibe_Database_Query::newWhere();
     $i = 0;
     foreach ($fields as $field => $sinal) {
         $val = $values[$field][0];
         $type = strtoupper($values[$field][1]);
         switch ($type) {
             case 'AND':
                 $where->andWhere($field, $val, $sinal, $this->columns_conf[$field]);
                 break;
             case 'OR':
                 $where->orWhere($field, $val, $sinal, $this->columns_conf[$field]);
                 break;
             case 'NOT':
                 $where->notWhere($field, $val, $sinal, $this->columns_conf[$field]);
                 break;
             default:
                 break;
         }
         $i++;
     }
     return $where;
 }
示例#3
0
 public function __construct($table = null)
 {
     parent::__construct(Ibe_Database_Query::SELECT);
     $this->table = $table;
 }