// Update an Interval Action
// UnexpectedError - failed to update interval action in the database
184620
func (mc MongoClient) UpdateIntervalAction(action contract.IntervalAction) error {
	var mapped models.IntervalAction
	id, err := mapped.FromContract(action)
	if err != nil {
		return err
	}

	mapped.TimestampForUpdate()

	return mc.updateId(db.IntervalAction, id, mapped)
}
1253436
func (e *ErrorRate) Update(rate float64) {
	e.QueryTotal++
	e.ErrorTotal += rate
}
449974
func (repo *repo) Update(user service.Entity) error {
	return dbconn.DB.Save(&user).Error
}
1169373
func Update(db DB, table string, src interface{}) error {
	return Default.Update(db, table, src)
}
1122642
func (c *Client) IntervalActionsWithLimit(limit int) (actions []contract.IntervalAction, err error) {
	conn := c.Pool.Get()
	defer conn.Close()

	objects, err := getObjectsByRange(conn, models.IntervalActionKey, 0, limit-1)
	if err != nil {
		if err != redis.ErrNil {
			return actions, err
		}
	}

	actions = make([]contract.IntervalAction, len(objects))
	for i, object := range objects {
		err = json.Unmarshal(object, &actions[i])
		if err != nil {
			return []contract.IntervalAction{}, err
		}
	}

	return actions, nil
}
106394
func (db *Database) buildUpdate() string {
	var query bytes.Buffer
	query.WriteString(db.buildCTE())
	query.WriteString("UPDATE ")

	// Model only
	if len(db.tables) != 1 {
		db.panicLog("Please set a table with Model to Update")
	}
	query.WriteString(db.tables[0])
	query.WriteString(" SET ")

	updateSize := len(db.updateCreateFields)
	if updateSize == 0 {
		db.panicLog("Unable to detect fields to update")
	}

	for j, field := range db.updateCreateFields {
		query.WriteString(handleIdentifier(field))
		query.WriteString(" = $")
		query.WriteString(strconv.Itoa(db.varCount))
		db.varCount++
		if j != updateSize-1 {
			query.WriteString(", ")
		}
	}

	// Where (optional)
	if len(db.whereFields) > 0 {
		query.WriteString(db.buildWhere())
	}

	query.WriteString(db.buildReturning())

	qs := query.String()
	db.printLog(qs)
	return qs
}
500234
func (r *controller) Update(ctx context.Context, t *api.Task) error {
	// TODO(stevvooe): While assignment of tasks is idempotent, we do allow
	// updates of metadata, such as labelling, as well as any other properties
	// that make sense.
	return nil
}
925894
func addIntervalActionToSchedulerDB(intervalAction contract.IntervalAction) (string, error) {
	var err error
	var id string

	id, err = dbClient.AddIntervalAction(intervalAction)
	if err != nil {
		LoggingClient.Error("problem trying to add interval action to support-scheduler service:" + err.Error())
		return "", err
	}
	LoggingClient.Info("added interval action to the support-scheduler", "name", intervalAction.Name, "id", id)

	return id, nil
}
116715
func (mc MongoClient) IntervalActionById(id string) (contract.IntervalAction, error) {
	s := mc.getSessionCopy()
	defer s.Close()

	query, err := idToBsonM(id)
	if err != nil {
		return contract.IntervalAction{}, err
	}

	var action models.IntervalAction
	if err := s.DB(mc.database.Name).C(db.IntervalAction).Find(query).One(&action); err != nil {
		return contract.IntervalAction{}, errorMap(err)
	}
	return action.ToContract(), nil
}
1254728
func (a *AnimationSystem) Update(dt float32) {
	for _, e := range a.entities {
		if e.AnimationComponent.CurrentAnimation == nil {
			if e.AnimationComponent.def == nil {
				continue
			}
			e.AnimationComponent.SelectAnimationByAction(e.AnimationComponent.def)
		}

		e.AnimationComponent.change += dt
		if e.AnimationComponent.change >= e.AnimationComponent.Rate {
			e.RenderComponent.Drawable = e.AnimationComponent.Cell()
			e.AnimationComponent.NextFrame()
		}
	}
}
209557
func (c *Client) DeleteIntervalActionById(id string) (err error) {
	check, err := c.IntervalActionById(id)
	if err != nil {
		if err == db.ErrNotFound {
			return nil
		}
		return
	}

	action := models.NewIntervalAction(check)
	conn := c.Pool.Get()
	defer conn.Close()

	_ = conn.Send("MULTI")
	deleteObject(action, id, conn)

	_, err = conn.Do("EXEC")

	return err
}
462334
func (_m *DBClient) IntervalActionsWithLimit(limit int) ([]models.IntervalAction, error) {
	ret := _m.Called(limit)

	var r0 []models.IntervalAction
	if rf, ok := ret.Get(0).(func(int) []models.IntervalAction); ok {
		r0 = rf(limit)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]models.IntervalAction)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(int) error); ok {
		r1 = rf(limit)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
942086
func (hb *Heartbeat) Update(d time.Duration) {
	atomic.StoreInt64(&hb.timeout, int64(d))
}
303855
func (entityApi *EntityApi) Update(id string, body []byte, options map[string]string) ([]byte, error) {
	request := api.CcaRequest{
		Method:   api.PUT,
		Body:     body,
		Endpoint: entityApi.buildEndpoint() + "/" + id,
		Options:  options,
	}
	response, err := entityApi.apiClient.Do(request)
	if err != nil {
		return nil, err
	} else if response.IsError() {
		return nil, api.CcaErrorResponse(*response)
	}
	return entityApi.taskService.PollResponse(response, DEFAULT_POLLING_INTERVAL)
}
554397
func (s *ExpDecaySample) Update(v int64) {
	s.update(time.Now(), v)
}
1134436
func (m *Message) Update(db *mgo.Database) error {

	if m.ID.Valid() {
		return db.C("messages").UpdateId(m.ID, bson.M{"$set": m})
	}
	return errors.New("Can't update message: ID is not set")
}
58837
func (mc MongoClient) getIntervalActions(q bson.M) ([]models.IntervalAction, error) {
	s := mc.getSessionCopy()
	defer s.Close()

	var mia []models.IntervalAction
	if err := s.DB(mc.database.Name).C(db.IntervalAction).Find(q).All(&mia); err != nil {
		return []models.IntervalAction{}, errorMap(err)
	}
	return mia, nil
}