($class, $db, $user, $params) = @_; # 変更がなかったら更新しない return if ( $user->name eq $params->{name} && $user->type eq $params->{type} ); $db->query(q[ UPDATE user SET name = :name, type = :type WHERE id = :id ], { name => $params->{name}, type => $params->{type}, id => $user->id, }); }