Atualiza um model de acordo com id fornecido e as propriedades informadas

@param integer $id
@param array   $data Array mapeando as colunas e valores a serem atualizados

@return mixed
@throws RepositoryException
347614
public function update($id, array $data)
    {
        $model = $this->find($id);

        if (!$model) {
            throw new RepositoryException("O item não solicitado não existe.");
        }

        $model->fill($data);

        $model->update();

        return $this->find($id);

    }
712387
public function update($id, array $data) : bool
    {
        if ($record = $this->find($id)) {
            $data = $this->preUpdate($this->parseData($data), $id, $record);
            return $this->postUpdate($data, $id, $record->update($data), $record);
        } else {
            $this->throwModelNotFoundException($id);
        }
    }
1355641
protected function _create(array $data, $id = null, array $parameters = []) {
        return parent::_create($data, $this->type(), $id, $parameters);
    }
926457
public function add(string $id, array $data = []): bool
    {
        try {
            $this->setFile($id);
            if ($this->file) {

                if (!file_exists($this->file)) {
                    //Novo
                    if($this->versionamento) {
                        $data['created'] = strtotime("now");
                        $data['updated'] = strtotime("now");
                        parent::deleteVerion($this->file);
                    }

                    $f = fopen($this->file, "w+");
                    fwrite($f, json_encode($data));
                    fclose($f);

                    return true;
                }
            }
            return false;
        } catch (\Exception $e) {
            return false;
        }
    }
1143282
public function onPurchase($id, array $data)
    {
        $data = $this->resolverFactory->createDevicePurchaseResolver()->resolve($data);

        return $this->api->request('POST', '/players/'.$id.'/on_purchase', [], json_encode($data));
    }
53929
public function set(array $data, $id = null) {
        $id = null === $id ? $this->idGen++ : $id;
        $this->data[$id] = $data;
        self::$dirty[$this->class] = true;
        return $id;
    }
735998
public function update($id, $data)
    {
        $response = $this->restClient->put($this->endpoint . '/' . $id, $data);

        return $response['body'];
    }
621201
public function saveById($id, $data)
    {
        $id = parent::saveById($id, $data);
        $this->setCacheItem($id, $data);
        return $id;
    }
762814
public function update(array $data, $id)
    {
        if( !is_integer($id) )
            throw new Exception("ID must be a integer");

        $handle = array('Id'=>$id);

        foreach( $data as $field => $value )
        {
            switch( strtolower($field) )
            {
                case 'name':
                    $this->client
                        ->debtorContact_SetName(array(
                            'debtorContactHandle' => $handle,
                            'value'               => $value
                        ));
                    break;

                case 'email':
                    $this->client
                        ->debtorContact_SetEmail(array(
                            'debtorContactHandle' => $handle,
                            'value'               => $value
                        ));
                    break;

                case 'phone':
                    $this->client
                        ->DebtorContact_SetTelephoneNumber(array(
                            'debtorContactHandle' => $handle,
                            'value'               => $value
                        ));
                    break;

                case 'invoice':
                    $this->client
                        ->debtorContact_SetIsToReceiveEmailCopyOfInvoice(array(
                            'debtorContactHandle' => $handle,
                            'value'               => !!$value
                        ));
                    break;

                case 'order':
                    $this->client
                        ->debtorContact_SetIsToReceiveEmailCopyOfOrder(array(
                            'debtorContactHandle' => $handle,
                            'value'               => !!$value
                        ));
                    break;

                case 'comment':
                    $this->client
                        ->debtorContact_SetComments(array(
                            'debtorContactHandle' => $handle,
                            'value'               => $value
                        ));
                    break;

            }
        }

        return $this->getArrayFromHandles($handle);
    }
653661
public function tokenize($id, array $data = [])
    {
        $assoc = $this->getConfig('associationAlias');

        $tokenData = [
            'foreign_alias' => $this->_table->getAlias(),
            'foreign_table' => $this->_table->getTable(),
            'foreign_key' => $id,
            'foreign_data' => $data,
        ];
        $tokenData = array_filter($tokenData);
        if (!isset($tokenData['foreign_data'])) {
            $tokenData['foreign_data'] = [];
        }

        $table = $this->_table->$assoc;
        $token = $table->newEntity($tokenData);

        if (!$table->save($token)) {
            throw new \RuntimeException();
        }

        return $token;
    }
1105596
public function put($id = null, $data = array())
    {

        $args = func_get_args();
        if(count($args) == 2){
            $args = $id;
        }else{
            $data = array_pop($args);
        }

        try {
            $this->client->request($this, 'put', $args, $data);
        } catch(Exception $ex) {
            $this->dispatchException($ex);
        }

        return true;
    }
452178
public function get(string $id): DataProviderInterface
    {
        if (!$this->has($id)) {
            throw new Exception('No data provider with id "'.$id.'" was loaded');
        }

        return $this->dataProviders[$id];
    }
1339351
public function saveById($id, $data)
    {
        $subData = array();
        foreach (array_keys($this->subAttributeList) as $subKey) {
            $subData[$subKey] = null;
            if (isset($data[$subKey])) {
                $subData[$subKey] = $data[$subKey];
                unset($data[$subKey]);
            }
        }
        $id = parent::saveById($id, $data);
        foreach (array_keys($this->subAttributeList) as $subKey) {
            $this->saveSubAttributeById($id, $subKey, $subData[$subKey]);
        }
        return $id;
    }
706973
public function updateNotification($id, array $data)
    {
        DB:: beginTransaction();
        try {
            $model         = $this->model->find($id);
            $model->active = array_get($data, 'active', 0);
            $model->save();
            $titles        = array_get($data, 'title', []);

            foreach ($titles as $langId => $title) {
                $content          = $model->contents()->getModel()->firstOrNew(['notification_id' => $id, 'lang_id' => $langId]);
                $content->content = $data['content'][$langId];
                $content->title   = $title;
                $content->subject = array_get($data, 'subject.' . $langId, '');

                $model->contents()->save($content);
            }
        } catch (Exception $ex) {
            DB::rollback();
            throw $ex;
        }
        DB::commit();
        return true;
    }
397882
public function update(array $data, $id)
    {
        if (array_key_exists('password', $data)) {
            $data['password'] = bcrypt($data['password']);
        }

        return parent::update($data, $id);
    }
1185502
public function update($id, array $data)
    {
        $this->validateId($id);

        $entity = $this->getById($id);
        $form   = $this->getEditForm();

        $form->bind($entity);
        $form->setData($data);

        if (!$valid = $form->isValid()) {
            return false;
        }

        $this->updateFromNode($entity);

        $this->getMapper()->save($entity);

        return $entity;
    }
87929
public function addVariations($id, $data) {
		// find
		$model = $this->get($id);

		if ($model === null) {
			return new NotFound(['message' => 'Skill not found.']);
		}

		// pass add to internal logic
		try {
			$this->doAddVariations($model, $data);
		} catch (ErrorsException $e) {
			return new NotValid(['errors' => $e->getErrors()]);
		}

		// save and dispatch events
		$this->dispatch(SkillEvent::PRE_VARIATIONS_ADD, $model, $data);
		$this->dispatch(SkillEvent::PRE_SAVE, $model, $data);
		$rows = $model->save();
		$this->dispatch(SkillEvent::POST_VARIATIONS_ADD, $model, $data);
		$this->dispatch(SkillEvent::POST_SAVE, $model, $data);

		if ($rows > 0) {
			return Updated(['model' => $model]);
		}

		return NotUpdated(['model' => $model]);
	}