Updates the given contact.

@param Contact $contact The contact to update

@return Contact
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);
    }
978115
public function pushLead($contact, $event = [])
    {
        $this->reset();
        $this->getEvent($event);

        if (empty($this->event['config']['contactclient'])) {
            return false;
        }

        /** @var Contact $contactModel */
        $clientModel = $this->getContactClientModel();
        $client      = $clientModel->getEntity($this->event['config']['contactclient']);

        $this->sendContact($client, $contact, false);

        // Returning false will typically cause a retry.
        // If an error occurred and we do not wish to retry we should return true.
        return $this->valid ? $this->valid : !$this->retry;
    }
883698
public function changeEmail($listId, Contact $contact, $oldEmail)
    {
        // get old contact properties
        $response = $this->mailjet->get(Resources::$Contactdata, ['id' => $oldEmail]);
        if (!$response->success()) {
            $this->throwError("ContactsListManager:changeEmail() failed", $response);
        }

        // copy contact properties
        $oldContactData = $response->getData();
        if (isset($oldContactData[0])) {
            $contact->setProperties($oldContactData[0]['Data']);
        }

        // add new contact
        $contact->setAction(Contact::ACTION_ADDFORCE);
        $response = $this->_exec($listId, $contact);
        if (!$response->success()) {
            $this->throwError("ContactsListManager:changeEmail() failed", $response);
        }

        // remove old
        $oldContact = new Contact($oldEmail);
        $oldContact->setAction(Contact::ACTION_REMOVE);
        $response = $this->_exec($listId, $oldContact);
        if (!$response->success()) {
            $this->throwError("ContactsListManager:changeEmail() failed", $response);
        }

        return $response->getData();
    }
1285772
public function update(...$table) {
        $sql = new UpdateSQL($table);
        $sql->setDialect($this->dialect);

        return $sql;
    }
713426
public function replaceContact($contactId, array $data = [])
	{
		return $this->sendRequest(
			$this->createRequest('PUT', sprintf('contacts/%d', $contactId), [], $data)
		);
	}
711363
public function setEmail(?string $value) : Contact
    {

        if ($this->data['email'] !== $value) {
            $this->data['email'] = $value;
            $this->setModified('email');
        }

        return $this;
    }
787342
public function getMainAccountContact($contact)
    {
        foreach ($contact->getAccountContacts() as $accountContact) {
            /** @var AccountContact $accountContact */
            if ($accountContact->getMain()) {
                return $accountContact;
            }
        }

        return false;
    }
850376
def update_contact(self, contact):
        

        if not isinstance(contact, dict):
            raise AttributeError('contact must be a <dict>')

        method, url = get_URL('contacts_update')

        payload = {
            'apikey': self.config.get('apikey'),
            'logintoken': self.session.cookies.get('logintoken'),
            'contactid': contact.get('contactid'),
            'name': contact.get('name'),
            'email': contact.get('email')
            }

        res = getattr(self.session, method)(url, params=payload)

        if res.status_code == 200:
            return True

        hellraiser(res)
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;
    }
827803
public function processFaxes($contact, $faxes)
    {
        $get = function($fax) {
            return $fax->getId();
        };

        $delete = function($fax) use ($contact) {
            $contact->removeFax($fax);

            return true;
        };

        $update = function($fax, $matchedEntry) {
            return $this->updateFax($fax, $matchedEntry);
        };

        $add = function($fax) use ($contact) {
            $this->addFax($contact, $fax);

            return true;
        };

        $entities = $contact->getFaxes();

        $result = $this->processSubEntities(
            $entities,
            $faxes,
            $get,
            $add,
            $update,
            $delete
        );

        $this->resetIndexOfSubentites($entities);

        // check main
        $this->setMainFax($contact);

        return $result;
    }
274816
public function processEmails($contact, $emails)
    {
        $get = function($email) {
            /* @var Email $email */

            return $email->getId();
        };

        $delete = function($email) use ($contact) {
            return $contact->removeEmail($email);
        };

        $update = function($email, $matchedEntry) {
            return $this->updateEmail($email, $matchedEntry);
        };

        $add = function($email) use ($contact) {
            return $this->addEmail($contact, $email);
        };

        $entities = $contact->getEmails();

        $result = $this->processSubEntities(
            $entities,
            $emails,
            $get,
            $add,
            $update,
            $delete
        );

        $this->resetIndexOfSubentites($entities);

        // check main
        $this->setMainEmail($contact);

        return $result;
    }
302504
public function setContactId($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }

        if ($this->contact_id !== $v) {
            $this->contact_id = $v;
            $this->modifiedColumns[DealerContactInfoTableMap::CONTACT_ID] = true;
        }

        if ($this->aDealerContact !== null && $this->aDealerContact->getId() !== $v) {
            $this->aDealerContact = null;
        }


        return $this;
    }
923225
public function delete(Contact $contact): void
    {
        $id = $contact->getId();

        $contact->setId(null);

        $this->client->delete($this->prepareUrlForKey('delete-contact', ['id' => $id]));
    }
236299
public function setContactClient(ContactClient $contactClient)
    {
        $this->contactClient = $contactClient;
        $this->setPayload($this->contactClient->getFilePayload());

        return $this;
    }
38116
public function removeContact(\Sulu\Bundle\ContactBundle\Entity\ContactInterface $contacts)
    {
        $this->contacts->removeElement($contacts);
    }
60402
private function resetContact($contact)
    {
        if ($contact->getCustomerId() && $contact->getEmailImported()) {
            $contact->setEmailImported(\Dotdigitalgroup\Email\Model\Contact::EMAIL_CONTACT_NOT_IMPORTED);
            $this->contactResource->save($contact);
        } elseif (! $contact->getCustomerId() && $contact->getIsSubscriber() && $contact->getSubscriberImported()) {
            $contact->setSubscriberImported(\Dotdigitalgroup\Email\Model\Contact::EMAIL_CONTACT_NOT_IMPORTED);
            $this->contactResource->save($contact);
        }
    }
314305
public function UpdateContacts(Request\UpdateContacts $UpdateContacts = null)
    {
        $uri = $this->getUri('/contact', array());

        return $this->put($uri, $UpdateContacts);
    }