PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13
1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 All 211 releases
charitable / vendor / square / square / src / Legacy / Models / OrderUpdatedObject.php

OrderUpdatedObject.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13, at vendor/square/square/src/Legacy/Models/OrderUpdatedObject.php

56 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Square\Legacy\Models;
6
7 use stdClass;
8
9 class OrderUpdatedObject implements \JsonSerializable
10 {
11 /**
12 * @var OrderUpdated|null
13 */
14 private $orderUpdated;
15
16 /**
17 * Returns Order Updated.
18 */
19 public function getOrderUpdated(): ?OrderUpdated
20 {
21 return $this->orderUpdated;
22 }
23
24 /**
25 * Sets Order Updated.
26 *
27 * @maps order_updated
28 */
29 public function setOrderUpdated(?OrderUpdated $orderUpdated): void
30 {
31 $this->orderUpdated = $orderUpdated;
32 }
33
34 /**
35 * Encode this object to JSON
36 *
37 * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
38 * are set. (default: false)
39 *
40 * @return array|stdClass
41 */
42 #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
43 public function jsonSerialize(bool $asArrayWhenEmpty = false)
44 {
45 $json = [];
46 if (isset($this->orderUpdated)) {
47 $json['order_updated'] = $this->orderUpdated;
48 }
49 $json = array_filter($json, function ($val) {
50 return $val !== null;
51 });
52
53 return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
54 }
55 }
56