示例#1
0
 /**
  * @return Wax_Db_Query_Insert
  */
 public function set($field, $value, $fn = null)
 {
     $this->_fields[] = $field;
     switch ($fn) {
         case self::MD5:
             $this->_values[] = "MD5(" . Wax_Db::quote($value) . ")";
             break;
         default:
             $this->_values[] = Wax_Db::quote($value);
             break;
     }
     return $this;
 }
示例#2
0
 /**
  * @return Wax_Db_Query_Delete
  */
 public function orWhere($condition)
 {
     $num = func_num_args();
     if ($num == 2) {
         $value = func_get_arg(1);
         if (is_array($value) || strpos($condition, Wax_Db::PLACEHOLDER)) {
             $condition = Wax_Db::quoteInto($condition, $value);
         } else {
             $condition = "{$condition} = " . Wax_Db::quote($value);
         }
     } elseif ($num > 1) {
         $bind = func_get_args();
         array_shift($bind);
         $condition = Wax_Db::quoteInto($condition, $bind);
     }
     if (sizeof($this->_where) != 0) {
         $this->_where[] = " OR ( {$condition} )";
     } else {
         $this->_where[] = " ( {$condition} )";
     }
     return $this;
 }