PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13.1
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13.1
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 / RetrieveTeamMemberResponse.php

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

93 lines 2.1 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 * Represents a response from a retrieve request containing a `TeamMember` object or error messages.
11 */
12 class RetrieveTeamMemberResponse implements \JsonSerializable
13 {
14 /**
15 * @var TeamMember|null
16 */
17 private $teamMember;
18
19 /**
20 * @var Error[]|null
21 */
22 private $errors;
23
24 /**
25 * Returns Team Member.
26 * A record representing an individual team member for a business.
27 */
28 public function getTeamMember(): ?TeamMember
29 {
30 return $this->teamMember;
31 }
32
33 /**
34 * Sets Team Member.
35 * A record representing an individual team member for a business.
36 *
37 * @maps team_member
38 */
39 public function setTeamMember(?TeamMember $teamMember): void
40 {
41 $this->teamMember = $teamMember;
42 }
43
44 /**
45 * Returns Errors.
46 * The errors that occurred during the request.
47 *
48 * @return Error[]|null
49 */
50 public function getErrors(): ?array
51 {
52 return $this->errors;
53 }
54
55 /**
56 * Sets Errors.
57 * The errors that occurred during the request.
58 *
59 * @maps errors
60 *
61 * @param Error[]|null $errors
62 */
63 public function setErrors(?array $errors): void
64 {
65 $this->errors = $errors;
66 }
67
68 /**
69 * Encode this object to JSON
70 *
71 * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
72 * are set. (default: false)
73 *
74 * @return array|stdClass
75 */
76 #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
77 public function jsonSerialize(bool $asArrayWhenEmpty = false)
78 {
79 $json = [];
80 if (isset($this->teamMember)) {
81 $json['team_member'] = $this->teamMember;
82 }
83 if (isset($this->errors)) {
84 $json['errors'] = $this->errors;
85 }
86 $json = array_filter($json, function ($val) {
87 return $val !== null;
88 });
89
90 return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
91 }
92 }
93