<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class SearchOrdersQuery implements \JsonSerializable { private $filter; private $sort; public function getFilter(): ?SearchOrdersFilter { return $this->filter; } public function setFilter(?SearchOrdersFilter $filter): void { $this->filter = $filter; } public function getSort(): ?SearchOrdersSort { return $this->sort; } public function setSort(?SearchOrdersSort $sort): void { $this->sort = $sort; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->filter)) { $json['filter'] = $this->filter; } if (isset($this->sort)) { $json['sort'] = $this->sort; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 