*/ class CustomerDto implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; /** * The original name of the model. * * @var string */ protected static $openAPIModelName = 'CustomerDto'; /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ protected static $openAPITypes = [ 'id' => 'int', 'last_name' => 'string', 'first_name' => 'string', 'nikcname' => 'string', 'phone' => 'string', 'mobile' => 'string', 'amka' => 'string', 'address' => 'string', 'post_code' => 'string', 'city' => 'string', 'country_code' => 'string', 'country_name' => 'string', 'birth_day' => '\DateTime', 'tax_number' => 'string', 'tax_office' => 'string', 'profession' => 'string', 'brand_id' => 'int', 'email' => 'string', 'notes' => 'string', 'eshop_id' => 'int' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] * @phpstan-var array * @psalm-var array */ protected static $openAPIFormats = [ 'id' => 'int32', 'last_name' => null, 'first_name' => null, 'nikcname' => null, 'phone' => null, 'mobile' => null, 'amka' => null, 'address' => null, 'post_code' => null, 'city' => null, 'country_code' => null, 'country_name' => null, 'birth_day' => 'date-time', 'tax_number' => null, 'tax_office' => null, 'profession' => null, 'brand_id' => 'int32', 'email' => 'email', 'notes' => null, 'eshop_id' => 'int32' ]; /** * Array of nullable properties. Used for (de)serialization * * @var boolean[] */ protected static array $openAPINullables = [ 'id' => false, 'last_name' => true, 'first_name' => true, 'nikcname' => true, 'phone' => true, 'mobile' => true, 'amka' => true, 'address' => true, 'post_code' => true, 'city' => true, 'country_code' => true, 'country_name' => true, 'birth_day' => true, 'tax_number' => true, 'tax_office' => true, 'profession' => true, 'brand_id' => false, 'email' => true, 'notes' => true, 'eshop_id' => false ]; /** * If a nullable field gets set to null, insert it here * * @var boolean[] */ protected array $openAPINullablesSetToNull = []; /** * Array of property to type mappings. Used for (de)serialization * * @return array */ public static function openAPITypes() { return self::$openAPITypes; } /** * Array of property to format mappings. Used for (de)serialization * * @return array */ public static function openAPIFormats() { return self::$openAPIFormats; } /** * Array of nullable properties * * @return array */ protected static function openAPINullables(): array { return self::$openAPINullables; } /** * Array of nullable field names deliberately set to null * * @return boolean[] */ private function getOpenAPINullablesSetToNull(): array { return $this->openAPINullablesSetToNull; } /** * Setter - Array of nullable field names deliberately set to null * * @param boolean[] $openAPINullablesSetToNull */ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void { $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; } /** * Checks if a property is nullable * * @param string $property * @return bool */ public static function isNullable(string $property): bool { return self::openAPINullables()[$property] ?? false; } /** * Checks if a nullable property is set to null. * * @param string $property * @return bool */ public function isNullableSetToNull(string $property): bool { return in_array($property, $this->getOpenAPINullablesSetToNull(), true); } /** * Array of attributes where the key is the local name, * and the value is the original name * * @var string[] */ protected static $attributeMap = [ 'id' => 'id', 'last_name' => 'lastName', 'first_name' => 'firstName', 'nikcname' => 'nikcname', 'phone' => 'phone', 'mobile' => 'mobile', 'amka' => 'amka', 'address' => 'address', 'post_code' => 'postCode', 'city' => 'city', 'country_code' => 'countryCode', 'country_name' => 'countryName', 'birth_day' => 'birthDay', 'tax_number' => 'taxNumber', 'tax_office' => 'taxOffice', 'profession' => 'profession', 'brand_id' => 'brandId', 'email' => 'email', 'notes' => 'notes', 'eshop_id' => 'eshopId' ]; /** * Array of attributes to setter functions (for deserialization of responses) * * @var string[] */ protected static $setters = [ 'id' => 'setId', 'last_name' => 'setLastName', 'first_name' => 'setFirstName', 'nikcname' => 'setNikcname', 'phone' => 'setPhone', 'mobile' => 'setMobile', 'amka' => 'setAmka', 'address' => 'setAddress', 'post_code' => 'setPostCode', 'city' => 'setCity', 'country_code' => 'setCountryCode', 'country_name' => 'setCountryName', 'birth_day' => 'setBirthDay', 'tax_number' => 'setTaxNumber', 'tax_office' => 'setTaxOffice', 'profession' => 'setProfession', 'brand_id' => 'setBrandId', 'email' => 'setEmail', 'notes' => 'setNotes', 'eshop_id' => 'setEshopId' ]; /** * Array of attributes to getter functions (for serialization of requests) * * @var string[] */ protected static $getters = [ 'id' => 'getId', 'last_name' => 'getLastName', 'first_name' => 'getFirstName', 'nikcname' => 'getNikcname', 'phone' => 'getPhone', 'mobile' => 'getMobile', 'amka' => 'getAmka', 'address' => 'getAddress', 'post_code' => 'getPostCode', 'city' => 'getCity', 'country_code' => 'getCountryCode', 'country_name' => 'getCountryName', 'birth_day' => 'getBirthDay', 'tax_number' => 'getTaxNumber', 'tax_office' => 'getTaxOffice', 'profession' => 'getProfession', 'brand_id' => 'getBrandId', 'email' => 'getEmail', 'notes' => 'getNotes', 'eshop_id' => 'getEshopId' ]; /** * Array of attributes where the key is the local name, * and the value is the original name * * @return array */ public static function attributeMap() { return self::$attributeMap; } /** * Array of attributes to setter functions (for deserialization of responses) * * @return array */ public static function setters() { return self::$setters; } /** * Array of attributes to getter functions (for serialization of requests) * * @return array */ public static function getters() { return self::$getters; } /** * The original name of the model. * * @return string */ public function getModelName() { return self::$openAPIModelName; } /** * Associative array for storing property values * * @var mixed[] */ protected $container = []; /** * Constructor * * @param mixed[]|null $data Associated array of property values * initializing the model */ public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], -1); $this->setIfExists('last_name', $data ?? [], ''); $this->setIfExists('first_name', $data ?? [], ''); $this->setIfExists('nikcname', $data ?? [], ''); $this->setIfExists('phone', $data ?? [], null); $this->setIfExists('mobile', $data ?? [], null); $this->setIfExists('amka', $data ?? [], null); $this->setIfExists('address', $data ?? [], null); $this->setIfExists('post_code', $data ?? [], null); $this->setIfExists('city', $data ?? [], null); $this->setIfExists('country_code', $data ?? [], 'GR'); $this->setIfExists('country_name', $data ?? [], null); $this->setIfExists('birth_day', $data ?? [], null); $this->setIfExists('tax_number', $data ?? [], null); $this->setIfExists('tax_office', $data ?? [], null); $this->setIfExists('profession', $data ?? [], null); $this->setIfExists('brand_id', $data ?? [], 0); $this->setIfExists('email', $data ?? [], null); $this->setIfExists('notes', $data ?? [], null); $this->setIfExists('eshop_id', $data ?? [], 0); } /** * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the * $this->openAPINullablesSetToNull array * * @param string $variableName * @param array $fields * @param mixed $defaultValue */ private function setIfExists(string $variableName, array $fields, $defaultValue): void { if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { $this->openAPINullablesSetToNull[] = $variableName; } $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { $invalidProperties = []; if (!is_null($this->container['last_name']) && (mb_strlen($this->container['last_name']) > 60)) { $invalidProperties[] = "invalid value for 'last_name', the character length must be smaller than or equal to 60."; } if (!is_null($this->container['first_name']) && (mb_strlen($this->container['first_name']) > 60)) { $invalidProperties[] = "invalid value for 'first_name', the character length must be smaller than or equal to 60."; } if (!is_null($this->container['nikcname']) && (mb_strlen($this->container['nikcname']) > 60)) { $invalidProperties[] = "invalid value for 'nikcname', the character length must be smaller than or equal to 60."; } if (!is_null($this->container['phone']) && (mb_strlen($this->container['phone']) > 15)) { $invalidProperties[] = "invalid value for 'phone', the character length must be smaller than or equal to 15."; } if (!is_null($this->container['mobile']) && (mb_strlen($this->container['mobile']) > 15)) { $invalidProperties[] = "invalid value for 'mobile', the character length must be smaller than or equal to 15."; } if (!is_null($this->container['amka']) && (mb_strlen($this->container['amka']) > 25)) { $invalidProperties[] = "invalid value for 'amka', the character length must be smaller than or equal to 25."; } if (!is_null($this->container['address']) && (mb_strlen($this->container['address']) > 120)) { $invalidProperties[] = "invalid value for 'address', the character length must be smaller than or equal to 120."; } if (!is_null($this->container['post_code']) && (mb_strlen($this->container['post_code']) > 10)) { $invalidProperties[] = "invalid value for 'post_code', the character length must be smaller than or equal to 10."; } if (!is_null($this->container['city']) && (mb_strlen($this->container['city']) > 50)) { $invalidProperties[] = "invalid value for 'city', the character length must be smaller than or equal to 50."; } if (!is_null($this->container['country_code']) && (mb_strlen($this->container['country_code']) > 2)) { $invalidProperties[] = "invalid value for 'country_code', the character length must be smaller than or equal to 2."; } if (!is_null($this->container['country_name']) && (mb_strlen($this->container['country_name']) > 20)) { $invalidProperties[] = "invalid value for 'country_name', the character length must be smaller than or equal to 20."; } if (!is_null($this->container['tax_number']) && (mb_strlen($this->container['tax_number']) > 30)) { $invalidProperties[] = "invalid value for 'tax_number', the character length must be smaller than or equal to 30."; } if (!is_null($this->container['tax_office']) && (mb_strlen($this->container['tax_office']) > 25)) { $invalidProperties[] = "invalid value for 'tax_office', the character length must be smaller than or equal to 25."; } if (!is_null($this->container['profession']) && (mb_strlen($this->container['profession']) > 60)) { $invalidProperties[] = "invalid value for 'profession', the character length must be smaller than or equal to 60."; } if (!is_null($this->container['email']) && (mb_strlen($this->container['email']) > 50)) { $invalidProperties[] = "invalid value for 'email', the character length must be smaller than or equal to 50."; } return $invalidProperties; } /** * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { return count($this->listInvalidProperties()) === 0; } /** * Gets id * * @return int|null */ public function getId() { return $this->container['id']; } /** * Sets id * * @param int|null $id Id πελάτη , -1 αν πρόκειται για καινούριο πελάτη * * @return self */ public function setId($id) { if (is_null($id)) { throw new \InvalidArgumentException('non-nullable id cannot be null'); } $this->container['id'] = $id; return $this; } /** * Gets last_name * * @return string|null */ public function getLastName() { return $this->container['last_name']; } /** * Sets last_name * * @param string|null $last_name last_name * * @return self */ public function setLastName($last_name) { if (is_null($last_name)) { array_push($this->openAPINullablesSetToNull, 'last_name'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); $index = array_search('last_name', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } if (!is_null($last_name) && (mb_strlen($last_name) > 60)) { throw new \InvalidArgumentException('invalid length for $last_name when calling CustomerDto., must be smaller than or equal to 60.'); } $this->container['last_name'] = $last_name; return $this; } /** * Gets first_name * * @return string|null */ public function getFirstName() { return $this->container['first_name']; } /** * Sets first_name * * @param string|null $first_name first_name * * @return self */ public function setFirstName($first_name) { if (is_null($first_name)) { array_push($this->openAPINullablesSetToNull, 'first_name'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); $index = array_search('first_name', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } if (!is_null($first_name) && (mb_strlen($first_name) > 60)) { throw new \InvalidArgumentException('invalid length for $first_name when calling CustomerDto., must be smaller than or equal to 60.'); } $this->container['first_name'] = $first_name; return $this; } /** * Gets nikcname * * @return string|null */ public function getNikcname() { return $this->container['nikcname']; } /** * Sets nikcname * * @param string|null $nikcname nikcname * * @return self */ public function setNikcname($nikcname) { if (is_null($nikcname)) { array_push($this->openAPINullablesSetToNull, 'nikcname'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); $index = array_search('nikcname', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } if (!is_null($nikcname) && (mb_strlen($nikcname) > 60)) { throw new \InvalidArgumentException('invalid length for $nikcname when calling CustomerDto., must be smaller than or equal to 60.'); } $this->container['nikcname'] = $nikcname; return $this; } /** * Gets phone * * @return string|null */ public function getPhone() { return $this->container['phone']; } /** * Sets phone * * @param string|null $phone ΣΤΑΘΕΡΟ ΤΗΛΕΦΩΝΟ * * @return self */ public function setPhone($phone) { if (is_null($phone)) { array_push($this->openAPINullablesSetToNull, 'phone'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); $index = array_search('phone', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } if (!is_null($phone) && (mb_strlen($phone) > 15)) { throw new \InvalidArgumentException('invalid length for $phone when calling CustomerDto., must be smaller than or equal to 15.'); } $this->container['phone'] = $phone; return $this; } /** * Gets mobile * * @return string|null */ public function getMobile() { return $this->container['mobile']; } /** * Sets mobile * * @param string|null $mobile ΚΙΝΗΤΟ ΤΗΛΕΦΩΝΟ * * @return self */ public function setMobile($mobile) { if (is_null($mobile)) { array_push($this->openAPINullablesSetToNull, 'mobile'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); $index = array_search('mobile', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } if (!is_null($mobile) && (mb_strlen($mobile) > 15)) { throw new \InvalidArgumentException('invalid length for $mobile when calling CustomerDto., must be smaller than or equal to 15.'); } $this->container['mobile'] = $mobile; return $this; } /** * Gets amka * * @return string|null */ public function getAmka() { return $this->container['amka']; } /** * Sets amka * * @param string|null $amka ΑΜΚΑ * * @return self */ public function setAmka($amka) { if (is_null($amka)) { array_push($this->openAPINullablesSetToNull, 'amka'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); $index = array_search('amka', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } if (!is_null($amka) && (mb_strlen($amka) > 25)) { throw new \InvalidArgumentException('invalid length for $amka when calling CustomerDto., must be smaller than or equal to 25.'); } $this->container['amka'] = $amka; return $this; } /** * Gets address * * @return string|null */ public function getAddress() { return $this->container['address']; } /** * Sets address * * @param string|null $address ΔΙΕΥΘΥΝΣΗ * * @return self */ public function setAddress($address) { if (is_null($address)) { array_push($this->openAPINullablesSetToNull, 'address'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); $index = array_search('address', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } if (!is_null($address) && (mb_strlen($address) > 120)) { throw new \InvalidArgumentException('invalid length for $address when calling CustomerDto., must be smaller than or equal to 120.'); } $this->container['address'] = $address; return $this; } /** * Gets post_code * * @return string|null */ public function getPostCode() { return $this->container['post_code']; } /** * Sets post_code * * @param string|null $post_code ΤΑΧΥΔΡΟΜΙΚΟΣ ΚΩΔΙΚΑΣ * * @return self */ public function setPostCode($post_code) { if (is_null($post_code)) { array_push($this->openAPINullablesSetToNull, 'post_code'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); $index = array_search('post_code', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } if (!is_null($post_code) && (mb_strlen($post_code) > 10)) { throw new \InvalidArgumentException('invalid length for $post_code when calling CustomerDto., must be smaller than or equal to 10.'); } $this->container['post_code'] = $post_code; return $this; } /** * Gets city * * @return string|null */ public function getCity() { return $this->container['city']; } /** * Sets city * * @param string|null $city city * * @return self */ public function setCity($city) { if (is_null($city)) { array_push($this->openAPINullablesSetToNull, 'city'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); $index = array_search('city', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } if (!is_null($city) && (mb_strlen($city) > 50)) { throw new \InvalidArgumentException('invalid length for $city when calling CustomerDto., must be smaller than or equal to 50.'); } $this->container['city'] = $city; return $this; } /** * Gets country_code * * @return string|null */ public function getCountryCode() { return $this->container['country_code']; } /** * Sets country_code * * @param string|null $country_code ΚΩΔΙΚΟΣ ΧΩΡΑΣ ISO 3166 ALPHA-2 * * @return self */ public function setCountryCode($country_code) { if (is_null($country_code)) { array_push($this->openAPINullablesSetToNull, 'country_code'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); $index = array_search('country_code', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } if (!is_null($country_code) && (mb_strlen($country_code) > 2)) { throw new \InvalidArgumentException('invalid length for $country_code when calling CustomerDto., must be smaller than or equal to 2.'); } $this->container['country_code'] = $country_code; return $this; } /** * Gets country_name * * @return string|null */ public function getCountryName() { return $this->container['country_name']; } /** * Sets country_name * * @param string|null $country_name country_name * * @return self */ public function setCountryName($country_name) { if (is_null($country_name)) { array_push($this->openAPINullablesSetToNull, 'country_name'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); $index = array_search('country_name', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } if (!is_null($country_name) && (mb_strlen($country_name) > 20)) { throw new \InvalidArgumentException('invalid length for $country_name when calling CustomerDto., must be smaller than or equal to 20.'); } $this->container['country_name'] = $country_name; return $this; } /** * Gets birth_day * * @return \DateTime|null */ public function getBirthDay() { return $this->container['birth_day']; } /** * Sets birth_day * * @param \DateTime|null $birth_day birth_day * * @return self */ public function setBirthDay($birth_day) { if (is_null($birth_day)) { array_push($this->openAPINullablesSetToNull, 'birth_day'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); $index = array_search('birth_day', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } $this->container['birth_day'] = $birth_day; return $this; } /** * Gets tax_number * * @return string|null */ public function getTaxNumber() { return $this->container['tax_number']; } /** * Sets tax_number * * @param string|null $tax_number ΑΦΜ ΠΕΛΑΤΗ * * @return self */ public function setTaxNumber($tax_number) { if (is_null($tax_number)) { array_push($this->openAPINullablesSetToNull, 'tax_number'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); $index = array_search('tax_number', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } if (!is_null($tax_number) && (mb_strlen($tax_number) > 30)) { throw new \InvalidArgumentException('invalid length for $tax_number when calling CustomerDto., must be smaller than or equal to 30.'); } $this->container['tax_number'] = $tax_number; return $this; } /** * Gets tax_office * * @return string|null */ public function getTaxOffice() { return $this->container['tax_office']; } /** * Sets tax_office * * @param string|null $tax_office ΔΟΥ * * @return self */ public function setTaxOffice($tax_office) { if (is_null($tax_office)) { array_push($this->openAPINullablesSetToNull, 'tax_office'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); $index = array_search('tax_office', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } if (!is_null($tax_office) && (mb_strlen($tax_office) > 25)) { throw new \InvalidArgumentException('invalid length for $tax_office when calling CustomerDto., must be smaller than or equal to 25.'); } $this->container['tax_office'] = $tax_office; return $this; } /** * Gets profession * * @return string|null */ public function getProfession() { return $this->container['profession']; } /** * Sets profession * * @param string|null $profession ΕΠΑΓΓΕΛΜΑ * * @return self */ public function setProfession($profession) { if (is_null($profession)) { array_push($this->openAPINullablesSetToNull, 'profession'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); $index = array_search('profession', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } if (!is_null($profession) && (mb_strlen($profession) > 60)) { throw new \InvalidArgumentException('invalid length for $profession when calling CustomerDto., must be smaller than or equal to 60.'); } $this->container['profession'] = $profession; return $this; } /** * Gets brand_id * * @return int|null */ public function getBrandId() { return $this->container['brand_id']; } /** * Sets brand_id * * @param int|null $brand_id ΚΩΔΙΚΟΣ ΕΓΚΑΤΑΣΤΑΣΗΣ * * @return self */ public function setBrandId($brand_id) { if (is_null($brand_id)) { throw new \InvalidArgumentException('non-nullable brand_id cannot be null'); } $this->container['brand_id'] = $brand_id; return $this; } /** * Gets email * * @return string|null */ public function getEmail() { return $this->container['email']; } /** * Sets email * * @param string|null $email email * * @return self */ public function setEmail($email) { if (is_null($email)) { array_push($this->openAPINullablesSetToNull, 'email'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); $index = array_search('email', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } if (!is_null($email) && (mb_strlen($email) > 50)) { throw new \InvalidArgumentException('invalid length for $email when calling CustomerDto., must be smaller than or equal to 50.'); } $this->container['email'] = $email; return $this; } /** * Gets notes * * @return string|null */ public function getNotes() { return $this->container['notes']; } /** * Sets notes * * @param string|null $notes notes * * @return self */ public function setNotes($notes) { if (is_null($notes)) { array_push($this->openAPINullablesSetToNull, 'notes'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); $index = array_search('notes', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } $this->container['notes'] = $notes; return $this; } /** * Gets eshop_id * * @return int|null */ public function getEshopId() { return $this->container['eshop_id']; } /** * Sets eshop_id * * @param int|null $eshop_id eshop_id * * @return self */ public function setEshopId($eshop_id) { if (is_null($eshop_id)) { throw new \InvalidArgumentException('non-nullable eshop_id cannot be null'); } $this->container['eshop_id'] = $eshop_id; return $this; } /** * Returns true if offset exists. False otherwise. * * @param integer|string $offset Offset * * @return boolean */ public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } /** * Gets offset. * * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } /** * Sets value based on offset. * * @param int|null $offset Offset * @param mixed $value Value to be set * * @return void */ public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; } else { $this->container[$offset] = $value; } } /** * Unsets offset. * * @param integer|string $offset Offset * * @return void */ public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } /** * Serializes the object to a value that can be serialized natively by json_encode(). * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); } /** * Gets the string presentation of the object * * @return string */ public function __toString() { return json_encode( ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT ); } /** * Gets a header-safe presentation of the object * * @return string */ public function toHeaderValue() { return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } }