| 1: | <?php |
| 2: | |
| 3: | |
| 4: | |
| 5: | |
| 6: | namespace Worldline\Connect\Sdk\V1\Domain; |
| 7: | |
| 8: | use UnexpectedValueException; |
| 9: | use Worldline\Connect\Sdk\Domain\DataObject; |
| 10: | |
| 11: | |
| 12: | |
| 13: | |
| 14: | class CustomerDevice extends DataObject |
| 15: | { |
| 16: | |
| 17: | |
| 18: | |
| 19: | public $acceptHeader = null; |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | public $browserData = null; |
| 25: | |
| 26: | |
| 27: | |
| 28: | |
| 29: | public $defaultFormFill = null; |
| 30: | |
| 31: | |
| 32: | |
| 33: | |
| 34: | public $deviceFingerprintTransactionId = null; |
| 35: | |
| 36: | |
| 37: | |
| 38: | |
| 39: | public $ipAddress = null; |
| 40: | |
| 41: | |
| 42: | |
| 43: | |
| 44: | public $locale = null; |
| 45: | |
| 46: | |
| 47: | |
| 48: | |
| 49: | public $timezoneOffsetUtcMinutes = null; |
| 50: | |
| 51: | |
| 52: | |
| 53: | |
| 54: | public $userAgent = null; |
| 55: | |
| 56: | |
| 57: | |
| 58: | |
| 59: | public function toObject() |
| 60: | { |
| 61: | $object = parent::toObject(); |
| 62: | if (!is_null($this->acceptHeader)) { |
| 63: | $object->acceptHeader = $this->acceptHeader; |
| 64: | } |
| 65: | if (!is_null($this->browserData)) { |
| 66: | $object->browserData = $this->browserData->toObject(); |
| 67: | } |
| 68: | if (!is_null($this->defaultFormFill)) { |
| 69: | $object->defaultFormFill = $this->defaultFormFill; |
| 70: | } |
| 71: | if (!is_null($this->deviceFingerprintTransactionId)) { |
| 72: | $object->deviceFingerprintTransactionId = $this->deviceFingerprintTransactionId; |
| 73: | } |
| 74: | if (!is_null($this->ipAddress)) { |
| 75: | $object->ipAddress = $this->ipAddress; |
| 76: | } |
| 77: | if (!is_null($this->locale)) { |
| 78: | $object->locale = $this->locale; |
| 79: | } |
| 80: | if (!is_null($this->timezoneOffsetUtcMinutes)) { |
| 81: | $object->timezoneOffsetUtcMinutes = $this->timezoneOffsetUtcMinutes; |
| 82: | } |
| 83: | if (!is_null($this->userAgent)) { |
| 84: | $object->userAgent = $this->userAgent; |
| 85: | } |
| 86: | return $object; |
| 87: | } |
| 88: | |
| 89: | |
| 90: | |
| 91: | |
| 92: | |
| 93: | |
| 94: | public function fromObject($object) |
| 95: | { |
| 96: | parent::fromObject($object); |
| 97: | if (property_exists($object, 'acceptHeader')) { |
| 98: | $this->acceptHeader = $object->acceptHeader; |
| 99: | } |
| 100: | if (property_exists($object, 'browserData')) { |
| 101: | if (!is_object($object->browserData)) { |
| 102: | throw new UnexpectedValueException('value \'' . print_r($object->browserData, true) . '\' is not an object'); |
| 103: | } |
| 104: | $value = new BrowserData(); |
| 105: | $this->browserData = $value->fromObject($object->browserData); |
| 106: | } |
| 107: | if (property_exists($object, 'defaultFormFill')) { |
| 108: | $this->defaultFormFill = $object->defaultFormFill; |
| 109: | } |
| 110: | if (property_exists($object, 'deviceFingerprintTransactionId')) { |
| 111: | $this->deviceFingerprintTransactionId = $object->deviceFingerprintTransactionId; |
| 112: | } |
| 113: | if (property_exists($object, 'ipAddress')) { |
| 114: | $this->ipAddress = $object->ipAddress; |
| 115: | } |
| 116: | if (property_exists($object, 'locale')) { |
| 117: | $this->locale = $object->locale; |
| 118: | } |
| 119: | if (property_exists($object, 'timezoneOffsetUtcMinutes')) { |
| 120: | $this->timezoneOffsetUtcMinutes = $object->timezoneOffsetUtcMinutes; |
| 121: | } |
| 122: | if (property_exists($object, 'userAgent')) { |
| 123: | $this->userAgent = $object->userAgent; |
| 124: | } |
| 125: | return $this; |
| 126: | } |
| 127: | } |
| 128: | |