function toSQL() { if (count($this->data) == 0) { return 'FALSE'; } return static::PART_NAME . '(' . \Radical\DB::A($this->data) . ')'; }
function toSQL() { if ($this->sql) { return $this->sql; } //Build Append Part $append = $this->_appendPart(); //Build Query $sql = 'INSERT ' . ($this->ignore === true ? 'IGNORE ' : ''); if (isset($this->values[0]) && is_array($this->values[0])) { $keys = array_keys($this->values[0]); $values = $this->values; } else { $keys = array_keys($this->values); $values = array($this->values); } $sql .= 'INTO `' . $this->table . '` '; if (count($keys)) { $sql .= '(`' . implode('`,`', $keys) . '`)'; } $sql .= ' VALUES'; foreach ($values as $k => $v) { $sql .= ($k != 0 ? ',' : '') . '(' . \Radical\DB::A($v) . ')'; } if (count($keys)) { $sql .= $append; } $this->sql = $sql; return $sql; }
function toSQL() { if (count($this->data)) { return 'SET ' . \Radical\DB::A(array_map(function ($r) { return $r->expr(); }, $this->data)); //Ugly hack } }