/**
  * @param \Magento\Sales\Api\Data\OrderAddressInterface $addrMage
  * @return \Praxigento\Odoo\Data\Odoo\Contact
  */
 public function _extractContact(\Magento\Sales\Api\Data\OrderAddressInterface $addrMage)
 {
     $result = $this->_manObj->create(\Praxigento\Odoo\Data\Odoo\Contact::class);
     /* collect data */
     $name = $addrMage->getName();
     $phone = $addrMage->getTelephone();
     $email = $addrMage->getEmail();
     $country = $addrMage->getCountryId();
     $state = $addrMage->getRegionCode();
     $city = $addrMage->getCity();
     $street = $addrMage->getStreet();
     // street data is array
     $street = implode('', $street);
     $zip = $addrMage->getPostcode();
     /* init Odoo data object */
     if ($name) {
         $result->setName($name);
     }
     if ($phone) {
         $result->setPhone($phone);
     }
     if ($email) {
         $result->setEmail($email);
     }
     if ($country) {
         $result->setCountry($country);
     }
     if ($state) {
         $result->setState($state);
     }
     if ($city) {
         $result->setCity($city);
     }
     if ($street) {
         $result->setStreet($street);
     }
     if ($zip) {
         $result->setZip($zip);
     }
     return $result;
 }
Exemple #2
0
 /**
  * Get telephone number
  *
  * @return string
  */
 public function getTelephone()
 {
     return $this->address->getTelephone();
 }