<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CatalogModifierOverride implements \JsonSerializable { private $modifierId; private $onByDefault; public function __construct(string $modifierId) { $this->modifierId = $modifierId; } public function getModifierId(): string { return $this->modifierId; } public function setModifierId(string $modifierId): void { $this->modifierId = $modifierId; } public function getOnByDefault(): ?bool { return $this->onByDefault; } public function setOnByDefault(?bool $onByDefault): void { $this->onByDefault = $onByDefault; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['modifier_id'] = $this->modifierId; if (isset($this->onByDefault)) { $json['on_by_default'] = $this->onByDefault; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 