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;
    }
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;
    }
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 ; }
Returns contact data as an array.
Either by provided address or contact.

@param array $addressData
@param ContactInterface $contact

@throws MissingAttributeException

@return array
Returns contact data as an array . Either by provided address or contact .