/** * @param object $object * @return $this * @throws UnexpectedValueException */ public function fromObject($object) { parent::fromObject($object); if (property_exists($object, 'billingAddress')) { if (!is_object($object->billingAddress)) { throw new UnexpectedValueException('value \'' . print_r($object->billingAddress, true) . '\' is not an object'); } $value = new Address(); $this->billingAddress = $value->fromObject($object->billingAddress); } if (property_exists($object, 'locale')) { $this->locale = $object->locale; } if (property_exists($object, 'personalInformation')) { if (!is_object($object->personalInformation)) { throw new UnexpectedValueException('value \'' . print_r($object->personalInformation, true) . '\' is not an object'); } $value = new PersonalInformationRiskAssessment(); $this->personalInformation = $value->fromObject($object->personalInformation); } if (property_exists($object, 'shippingAddress')) { if (!is_object($object->shippingAddress)) { throw new UnexpectedValueException('value \'' . print_r($object->shippingAddress, true) . '\' is not an object'); } $value = new AddressPersonal(); $this->shippingAddress = $value->fromObject($object->shippingAddress); } return $this; }
/** * @param object $object * @return $this * @throws UnexpectedValueException */ public function fromObject($object) { parent::fromObject($object); if (property_exists($object, 'customerAccount')) { if (!is_object($object->customerAccount)) { throw new UnexpectedValueException('value \'' . print_r($object->customerAccount, true) . '\' is not an object'); } $value = new PaymentProduct840CustomerAccount(); $this->customerAccount = $value->fromObject($object->customerAccount); } if (property_exists($object, 'customerAddress')) { if (!is_object($object->customerAddress)) { throw new UnexpectedValueException('value \'' . print_r($object->customerAddress, true) . '\' is not an object'); } $value = new Address(); $this->customerAddress = $value->fromObject($object->customerAddress); } return $this; }
/** * @param object $object * @return $this * @throws UnexpectedValueException */ public function fromObject($object) { parent::fromObject($object); if (property_exists($object, 'name')) { if (!is_object($object->name)) { throw new UnexpectedValueException('value \'' . print_r($object->name, true) . '\' is not an object'); } $value = new PersonalName(); $this->name = $value->fromObject($object->name); } return $this; }
/** * @param object $object * @return $this * @throws UnexpectedValueException */ public function fromObject($object) { parent::fromObject($object); if (property_exists($object, 'address')) { if (!is_object($object->address)) { throw new UnexpectedValueException('value \'' . print_r($object->address, true) . '\' is not an object'); } $value = new Address(); $this->address = $value->fromObject($object->address); } if (property_exists($object, 'companyInformation')) { if (!is_object($object->companyInformation)) { throw new UnexpectedValueException('value \'' . print_r($object->companyInformation, true) . '\' is not an object'); } $value = new CompanyInformation(); $this->companyInformation = $value->fromObject($object->companyInformation); } if (property_exists($object, 'contactDetails')) { if (!is_object($object->contactDetails)) { throw new UnexpectedValueException('value \'' . print_r($object->contactDetails, true) . '\' is not an object'); } $value = new ContactDetailsBase(); $this->contactDetails = $value->fromObject($object->contactDetails); } if (property_exists($object, 'merchantCustomerId')) { $this->merchantCustomerId = $object->merchantCustomerId; } if (property_exists($object, 'name')) { if (!is_object($object->name)) { throw new UnexpectedValueException('value \'' . print_r($object->name, true) . '\' is not an object'); } $value = new PersonalName(); $this->name = $value->fromObject($object->name); } return $this; }