<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CatalogModifier implements \JsonSerializable { private $name; private $priceMoney; private $ordinal; private $modifierListId; private $imageIds; public function getName(): ?string { return $this->name; } public function setName(?string $name): void { $this->name = $name; } public function getPriceMoney(): ?Money { return $this->priceMoney; } public function setPriceMoney(?Money $priceMoney): void { $this->priceMoney = $priceMoney; } public function getOrdinal(): ?int { return $this->ordinal; } public function setOrdinal(?int $ordinal): void { $this->ordinal = $ordinal; } public function getModifierListId(): ?string { return $this->modifierListId; } public function setModifierListId(?string $modifierListId): void { $this->modifierListId = $modifierListId; } public function getImageIds(): ?array { return $this->imageIds; } public function setImageIds(?array $imageIds): void { $this->imageIds = $imageIds; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->name)) { $json['name'] = $this->name; } if (isset($this->priceMoney)) { $json['price_money'] = $this->priceMoney; } if (isset($this->ordinal)) { $json['ordinal'] = $this->ordinal; } if (isset($this->modifierListId)) { $json['modifier_list_id'] = $this->modifierListId; } if (isset($this->imageIds)) { $json['image_ids'] = $this->imageIds; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 