<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class SubscriptionPhase implements \JsonSerializable { private $uid; private $cadence; private $periods; private $recurringPriceMoney; private $ordinal; public function __construct(string $cadence) { $this->cadence = $cadence; } public function getUid(): ?string { return $this->uid; } public function setUid(?string $uid): void { $this->uid = $uid; } public function getCadence(): string { return $this->cadence; } public function setCadence(string $cadence): void { $this->cadence = $cadence; } public function getPeriods(): ?int { return $this->periods; } public function setPeriods(?int $periods): void { $this->periods = $periods; } public function getRecurringPriceMoney(): ?Money { return $this->recurringPriceMoney; } public function setRecurringPriceMoney(?Money $recurringPriceMoney): void { $this->recurringPriceMoney = $recurringPriceMoney; } public function getOrdinal(): ?int { return $this->ordinal; } public function setOrdinal(?int $ordinal): void { $this->ordinal = $ordinal; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->uid)) { $json['uid'] = $this->uid; } $json['cadence'] = $this->cadence; if (isset($this->periods)) { $json['periods'] = $this->periods; } if (isset($this->recurringPriceMoney)) { $json['recurring_price_money'] = $this->recurringPriceMoney; } if (isset($this->ordinal)) { $json['ordinal'] = $this->ordinal; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 