Get the address (with the given id)
@param int $contactAddressId
@return models\Call\ContactAddress
165041
public function getFromId( $contactAddressId){
        $rest = $this->getService( self::API_ADDRESS . $contactAddressId);
        $rest->GET();

        return $rest->getResult( models\Call\ContactAddress::class);
    }
903524
public function addAddresse(\Sulu\Bundle\ContactBundle\Entity\Address $addresses)
    {
        $this->addresses[] = $addresses;

        return $this;
    }
591037
protected function getAddresses() {
        if (!$this->_addresses) {
            $this->_addresses = new AddressList($this->version, $this->solution['sid']);
        }

        return $this->_addresses;
    }
933905
public function getContactsInList($contactListId, array $filters = [])
	{
		return $this->sendRequest(
			$this->createRequest('GET', sprintf('contact_lists/%d/contacts', $contactListId), [
				'query' => $filters
			])
		);		
	}
931151
public function addaddress()
    {
        $form = $this->getOwner()->AddressForm();
        $member = Security::getCurrentUser();

        $form
            ->Fields()
            ->dataFieldByName("ContactID")
            ->setValue($member->Contact()->ID);

        $this
            ->getOwner()
            ->customise([
                "Title" => _t(
                    "SilverCommerce\ContactAdmin.AddAddress",
                    "Add Address"
                ),
                "MetaTitle" => _t(
                    "SilverCommerce\ContactAdmin.AddAddress",
                    "Add Address"
                ),
                "Form" => $form
            ]);

        $this->getOwner()->extend("updateAddAddress");

        return $this
            ->getOwner()
            ->renderWith([
                'AccountController_addaddress',
                AccountController::class . '_addaddress',
                'AccountController',
                AccountController::class,
                'Page'
            ]);
    }
100104
protected function getListAccountAddress()
    {
        $addresses = $this->address->getTranslatedList($this->data_user['user_id']);
        return $this->prepareListAccountAddress($addresses);
    }
678948
public function create( models\Call\ContactAddress $contactAddress){
        $rest = $this->getService( self::API_ADDRESS);
        $rest->POST( $contactAddress);

        return $rest->getResult( models\Call\ContactAddress::class);
    }
1237569
public function getContact($id)
    {
        //get contact from db
        foreach ($this->contacts as $contact) {
            if ($contact->id == $id) {
                return $contact;
            }
        }
        //might wanna throw an exception when it does not exists
        throw new Exception("Contact '$id' not found");
    }
431328
public function deleteContact($contactId)
    {
        if (is_null($contactId) || $contactId == '') {
            throw new Exception('The contactId is required to delete a contact.');
        }

        $params = array(
            'method' => 'sp.contact.delete',
            'contact_id' => $contactId
        );

        return $this->_makeApiRequest($params);
    }
1032618
public function setContactID($contactID)
    {
        if (trim($contactID) == null)
        {
            throw new InvalidArgumentException("You must supply a contact ID.");
        }

        if (!is_numeric($contactID))
        {
            throw new InvalidArgumentException("Contact ID must be numeric.");
        }
        $this->contactID = intval($contactID);
    }
399880
private function addressQuery(string $formattedAddress) : string
    {
        $url = sprintf(self::API_ADDRESS_URL_SSL, rawurlencode($formattedAddress));
        $url = $this->buildQuery($url, $this->apiKey, $this->locale, $this->region);

        return $url;
    }
586066
public function getContactData($addressData, ContactInterface $contact = null)
    {
        $result = [];

        if ($contact) {
            $this->mergeContactIntoAddressData($result, $contact);
        } elseif ($addressData && isset($addressData['firstName']) && isset($addressData['lastName'])) {
            $result['firstName'] = $addressData['firstName'];
            $result['lastName'] = $addressData['lastName'];
            $result['fullName'] = $result['firstName'] . ' ' . $result['lastName'];
            if (isset($addressData['title'])) {
                $result['title'] = $addressData['title'];
            }
            if (isset($addressData['salutation'])) {
                $result['salutation'] = $addressData['salutation'];
            }
            if (isset($addressData['formOfAddress'])) {
                $result['formOfAddress'] = $addressData['formOfAddress'];
            }
        } else {
            throw new MissingAttributeException('firstName, lastName or contact');
        }

        return $result;
    }
1201651
public function findAddress($customerId, $addressId)
    {
        $response = $this
            ->createQueryBuilder('c')
            ->select(
                ['c', 'a']
            )
            ->innerJoin('c.addresses', 'a')
            ->where('c.id = :customerId')
            ->andWhere('a.id = :addressId')
            ->setParameter('customerId', $customerId)
            ->setParameter('addressId', $addressId)
            ->setMaxResults(1)
            ->getQuery()
            ->getResult();

        if (!empty($response)) {
            /**
             * @var CustomerInterface $customer
             */
            $customer = reset($response);
            $addresses = $customer->getAddresses();
            if ($addresses) {
                return $addresses->first();
            }
        }

        return false;
    }
22699
public function setContactAddress(\Sulu\Bundle\ContactBundle\Entity\Address $contactAddress = null)
    {
        $this->entity->setContactAddress($contactAddress);

        return $this;
    }
1030382
public function getContactId($email, $websiteId)
    {
        if (! $this->isEnabled($websiteId)) {
            return false;
        }

        $contactFromTable = $this->getContactByEmail($email, $websiteId);
        if ($contactId = $contactFromTable->getContactId()) {
            return $contactId;
        }

        $contact = $this->getContact($email, $websiteId, $contactFromTable);
        if ($contact && isset($contact->id)) {
            return $contact->id;
        }

        return false;
    }
43980
public function getAddresses()
    {
        $accountAddresses = $this->entity->getAccountAddresses();
        $addresses = [];

        if (!is_null($accountAddresses)) {
            /** @var ContactAddress $accountAddress */
            foreach ($accountAddresses as $accountAddress) {
                $address = $accountAddress->getAddress();
                $address->setPrimaryAddress($accountAddress->getMain());
                $addresses[] = new Address($address, $this->locale);
            }
        }

        return $addresses;
    }
404799
protected function removeOrderAddressIfContactAddressIdIsEqualTo($item, $contactAddressId)
    {
        $deliveryAddress = $item->getDeliveryAddress();
        if ($deliveryAddress
            && $deliveryAddress->getContactAddress()
            && $deliveryAddress->getContactAddress()->getID() === $contactAddressId
        ) {
            $item->setDeliveryAddress(null);
            $this->em->remove($deliveryAddress);
        }
    }