Updates a contact.

@param string|int $contactId
@param array $data

@return object
515968
public function updateContact($contactId, $data)
    {
        $url = $this->getApiEndpoint() . self::REST_CONTACTS . $contactId;
        $this->setUrl($url)
            ->setVerb('PUT')
            ->buildPostBody($data);

        $response = $this->execute();
        if (isset($response->message)) {
            $message = 'ERROR : UPDATE SINGLE CONTACT : ' . $url . ' message : '
                . $response->message;
            $this->helper->debug('updateContact', [$message]);
            $this->helper->debug('updateContact', $data);
        }

        return $response;
    }
90976
protected function update($data)
    {
        try {

            if ($this->updateTouch) {
                $data[$this->updateTouchName] = date('Y-m-d H:i:s');
            }

            $this->db->update(
                $this->table,
                $this->fromArray($data),
                [
                    $this->primaryKey => $data[$this->primaryKey]
                ]
            );

            $id = $data[$this->primaryKey];

        } catch (\Exception $e) {
            throw $e;
        }

        return $id;
    }
555310
public function setContactId($contactId)
    {
        if ($contactId instanceof Lead) {
            $this->setContact($contactId);
        } elseif (\is_int($contactId)) {
            $this->contactId = $contactId;
        } else {
            throw new \InvalidArgumentException(
                '$contact must be an integer or instance of "\\Mautic\\LeadBundle\\Entity\\Lead"'
            );
        }

        return $this;
    }
1097546
function getById($contactId){
        return new Contact(
            $this->getContext(),
            new ResourcePathEntity($this->getContext(),$this->getResourcePath(),$contactId)
        );
    }
191228
public function update($id, array $data)
    {
        $chatbot = $this->client->put(
            sprintf('buckets/%d/chats/%d/integrations/%d.json', $this->bucket, $this->parent, $id),
            [
                'json' => $data
            ]
        );
        $chatbot = new Chatbot($this->response($chatbot));
        $chatbot->inContext($this->bucket, $this->parent);

        return $chatbot;
    }
397882
public function update(array $data, $id)
    {
        if (array_key_exists('password', $data)) {
            $data['password'] = bcrypt($data['password']);
        }

        return parent::update($data, $id);
    }
746836
public function update($id, $data)
	{
		$this->getResponse()
			->setStatusCode(Response::STATUS_CODE_201);

		$returnData = '';
		$action = strtolower($this->params()->fromQuery('action'));
		$classifiedService = $this->getServiceLocator()->get('document.service.classified');
		
		switch($action) {
			case 'activation':
				try {
					$classifiedService->activate($id);		
					$returnData = array(
						'status' => 'success',
						'message' => 'Annuncio attivato con successo. Ti ricordiamo che potrebbero essere 
							necessarie alcune ore prima di poter visualizzare l\'annuncio.'
					);
				} catch(\Exception $e) {
					$this->getResponse()
						->setStatusCode(Response::STATUS_CODE_500);
					$returnData = array(
						'status' => 'danger',
						'message' => $e->getMessage()
					);
				}
				break;
			case 'disableenable':
				try {
					$classifiedService->enableDisable($id);		
					$returnData = array(
						'status' => 'success',
						'message' => 'Annuncio modificato con successo'
					);
				} catch(\Exception $e) {
					$this->getResponse()
						->setStatusCode(Response::STATUS_CODE_500);
					$returnData = array(
						'status' => 'danger',
						'message' => $e->getMessage()
					);
				}
				break;
			case 'touch':
				try {
					$classifiedService->touch($id);		
					$returnData = array(
						'status' => 'success',
						'message' => 'Annuncio aggiornato con successo'
					);
				} catch(\Exception $e) {
					$this->getResponse()
						->setStatusCode(Response::STATUS_CODE_500);
					$returnData = array(
						'status' => 'danger',
						'message' => $e->getMessage()
					);
				}
				break;
		}
		
		return new JsonModel($returnData);
	}
898207
private function update($id, $data)
    {
        foreach ($data as $key => $value) {
            $fields[] = $key . ' = ?';
        }
        $query = 'UPDATE ' . self::DIAGNOSTIC_TABLE . ' SET ' . implode(', ', $fields) .
                 ' WHERE ' . self::DIAGNOSTIC_ID . ' = ?';
        return $this->persistence->exec($query, array_merge(array_values($data), array($id)));
    }
13426
public function update($role_id, array $data)
    {
        $result = null;
        $this->hook->attach('user.role.update.before', $role_id, $data, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        $result = (bool) $this->db->update('role', $data, array('role_id' => $role_id));
        $this->hook->attach('user.role.update.after', $role_id, $data, $result, $this);
        return (bool) $result;
    }
967841
def update_contact(contact)
      raise "contact_id or contact_number is required for updating contacts" if contact.contact_id.nil? and contact.contact_number.nil?
      save_contact(contact)
    end
485419
public function update(Contact $contact): Contact
    {
        $id = $contact->getId();

        $contact->setId(null);

        $response = $this->client->put($this->prepareUrlForKey('update-contact', ['id' => $id]), [], $contact->jsonSerialize());
        $responseData = $response->getDecodedBody();

        return new Contact($responseData);
    }
632582
public function updateContactList($contactListId, array $data = [])
	{
		return $this->sendRequest(
			$this->createRequest('PATCH', sprintf('contact_lists/%d', $contactListId), [], $data)
		);
	}
194127
public function update($id, array $data)
    {
        $project = $this->client->put(sprintf('projects/%d.json', $id), [
            'json' => $data,
        ]);

        return new Project($this->response($project));
    }
313915
public function update($id, $data) {
		$dt = $this->getDataTable();
		
		if (! $dt)
			return $this->createResponse($this->getNameManager()->getTableNames(), 401, "Tabels");
		
		return $this->createResponse([], 200, "{$this->getNameManager()->entityName}: No Update");
	}
109136
public function updateByStringId(array $data, string $id): Model
    {
        $model = $this->byStringIdOrFail($id);

        return $this->updateByModel($model, $data);
    }
44522
public static function remove_contact(int $userid, int $contactid) {
        global $DB;

        if ($contact = self::get_contact($userid, $contactid)) {
            $DB->delete_records('message_contacts', ['id' => $contact->id]);

            $event = \core\event\message_contact_removed::create(array(
                'objectid' => $contact->id,
                'userid' => $userid,
                'relateduserid' => $contactid,
                'context' => \context_user::instance($userid)
            ));
            $event->add_record_snapshot('message_contacts', $contact);
            $event->trigger();
        }
    }
1193550
public function update($id, array $data, $return_model = false){
        $model = $this->find($id);
        if($return_model){
            $model->update($data);
            return $model;
        }
        return $model->update($data);
    }