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 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 All 212 releases
charitable / vendor / square / square / src / Legacy / Models / ListDisputeEvidenceRequest.php

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

82 lines 2.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 /**
10 * Defines the parameters for a `ListDisputeEvidence` request.
11 */
12 class ListDisputeEvidenceRequest implements \JsonSerializable
13 {
14 /**
15 * @var array
16 */
17 private $cursor = [];
18
19 /**
20 * Returns Cursor.
21 * A pagination cursor returned by a previous call to this endpoint.
22 * Provide this cursor to retrieve the next set of results for the original query.
23 * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-
24 * patterns/pagination).
25 */
26 public function getCursor(): ?string
27 {
28 if (count($this->cursor) == 0) {
29 return null;
30 }
31 return $this->cursor['value'];
32 }
33
34 /**
35 * Sets Cursor.
36 * A pagination cursor returned by a previous call to this endpoint.
37 * Provide this cursor to retrieve the next set of results for the original query.
38 * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-
39 * patterns/pagination).
40 *
41 * @maps cursor
42 */
43 public function setCursor(?string $cursor): void
44 {
45 $this->cursor['value'] = $cursor;
46 }
47
48 /**
49 * Unsets Cursor.
50 * A pagination cursor returned by a previous call to this endpoint.
51 * Provide this cursor to retrieve the next set of results for the original query.
52 * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-
53 * patterns/pagination).
54 */
55 public function unsetCursor(): void
56 {
57 $this->cursor = [];
58 }
59
60 /**
61 * Encode this object to JSON
62 *
63 * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
64 * are set. (default: false)
65 *
66 * @return array|stdClass
67 */
68 #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
69 public function jsonSerialize(bool $asArrayWhenEmpty = false)
70 {
71 $json = [];
72 if (!empty($this->cursor)) {
73 $json['cursor'] = $this->cursor['value'];
74 }
75 $json = array_filter($json, function ($val) {
76 return $val !== null;
77 });
78
79 return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
80 }
81 }
82