public static function updateColumn(
        $db,
        $table,
        $field,
        $value,
        $id_field,
        $ids,
        $where = null
    ) {
        $ids = self::initArray($ids);

        if (count($ids) === 0) {
            return;
        }

        $field = new SwatDBField($field, 'integer');
        $id_field = new SwatDBField($id_field, 'integer');

        $sql = 'update %s set %s = %s where %s in (%s) %s';

        foreach ($ids as &$id) {
            $id = $db->quote($id, $id_field->type);
        }

        $id_list = implode(',', $ids);

        $where = $where === null ? '' : 'and ' . $where;

        $sql = sprintf(
            $sql,
            $table,
            $field->name,
            $db->quote($value, $field->type),
            $id_field->name,
            $id_list,
            $where
        );

        return self::exec($db, $sql);
    }