src/Colorium/Orm/SQL.php
public static function update($table, array $set, array $where = [])
    {
        $sql = $values = $fields = [];
        $sql[] = 'UPDATE ' . static::e($table);

        foreach($set as $field => $value) {
            $fields[] = static::e($field) . ' = ?';
            $values[] = $value;
        }

        $sql[] = 'SET ' . implode(', ', $fields);

        if($where) {
            $clause = [];
            foreach($where as $exp => $data) {
                $clause[] = $exp;
                if(is_array($data)) {
                    $values = array_merge($values, $data);
                    continue;
                }
                $values[] = $data;
            }
            $sql[] = 'WHERE ' . implode(' AND ', $clause);
        }

        $sql = implode("\n", $sql);
        return [$sql, $values];
    }
public static function update($table, array $set, array $where = [])
    {
        $sql = $values = $fields = [];
        $sql[] = 'UPDATE ' . static::e($table);

        foreach($set as $field => $value) {
            $fields[] = static::e($field) . ' = ?';
            $values[] = $value;
        }

        $sql[] = 'SET ' . implode(', ', $fields);

        if($where) {
            $clause = [];
            foreach($where as $exp => $data) {
                $clause[] = $exp;
                if(is_array($data)) {
                    $values = array_merge($values, $data);
                    continue;
                }
                $values[] = $data;
            }
            $sql[] = 'WHERE ' . implode(' AND ', $clause);
        }

        $sql = implode("\n", $sql);
        return [$sql, $values];
    }
Compile UPDATE

@param string $table
@param array $set
@param array $where
@return array