public function setOrderAddress($orderAddress, $addressData, $contact = null, $account = null)
    {
        // Check if address with id can be found.
        $contactData = $this->getContactData($addressData, $contact);
        // Add contact data.
        if ($contactData) {
            $orderAddress->setFirstName($contactData['firstName']);
            $orderAddress->setLastName($contactData['lastName']);
            if (isset($contactData['title'])) {
                $orderAddress->setTitle($contactData['title']);
            }
            if (isset($contactData['salutation'])) {
                $orderAddress->setSalutation($contactData['salutation']);
            }
            if (isset($contactData['formOfAddress'])) {
                $orderAddress->setFormOfAddress($contactData['formOfAddress']);
            }
        }

        // Add account data.
        $orderAddress->setAccountName(null);
        $orderAddress->setUid(null);

        if ($account) {
            $orderAddress->setAccountName($account->getName());
            $orderAddress->setUid($account->getUid());
        }

        // TODO: add phone

        $this->setAddressDataForOrder($orderAddress, $addressData);
    }
public function setOrderAddress($orderAddress, $addressData, $contact = null, $account = null)
    {
        // Check if address with id can be found.
        $contactData = $this->getContactData($addressData, $contact);
        // Add contact data.
        if ($contactData) {
            $orderAddress->setFirstName($contactData['firstName']);
            $orderAddress->setLastName($contactData['lastName']);
            if (isset($contactData['title'])) {
                $orderAddress->setTitle($contactData['title']);
            }
            if (isset($contactData['salutation'])) {
                $orderAddress->setSalutation($contactData['salutation']);
            }
            if (isset($contactData['formOfAddress'])) {
                $orderAddress->setFormOfAddress($contactData['formOfAddress']);
            }
        }

        // Add account data.
        $orderAddress->setAccountName(null);
        $orderAddress->setUid(null);

        if ($account) {
            $orderAddress->setAccountName($account->getName());
            $orderAddress->setUid($account->getUid());
        }

        // TODO: add phone

        $this->setAddressDataForOrder($orderAddress, $addressData);
    }
public function setOrderAddress ( $ orderAddress , $ addressData , $ contact = null , $ account = null ) { // Check if address with id can be found. $ contactData = $ this -> getContactData ( $ addressData , $ contact ) ; // Add contact data. if ( $ contactData ) { $ orderAddress -> setFirstName ( $ contactData [ 'firstName' ] ) ; $ orderAddress -> setLastName ( $ contactData [ 'lastName' ] ) ; if ( isset ( $ contactData [ 'title' ] ) ) { $ orderAddress -> setTitle ( $ contactData [ 'title' ] ) ; } if ( isset ( $ contactData [ 'salutation' ] ) ) { $ orderAddress -> setSalutation ( $ contactData [ 'salutation' ] ) ; } if ( isset ( $ contactData [ 'formOfAddress' ] ) ) { $ orderAddress -> setFormOfAddress ( $ contactData [ 'formOfAddress' ] ) ; } } // Add account data. $ orderAddress -> setAccountName ( null ) ; $ orderAddress -> setUid ( null ) ; if ( $ account ) { $ orderAddress -> setAccountName ( $ account -> getName ( ) ) ; $ orderAddress -> setUid ( $ account -> getUid ( ) ) ; } // TODO: add phone $ this -> setAddressDataForOrder ( $ orderAddress , $ addressData ) ; }
Sets an order address based on given data

@param OrderAddressInterface $orderAddress
@param array $addressData
@param ContactInterface $contact
@param Account|null $account

@throws OrderDependencyNotFoundException
Sets an order address based on given data