commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ModifiedByModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
18 
22 final class ModifiedByModel extends JsonObjectModel implements ModifiedBy
23 {
24 
25 
30  protected $isPlatformClient;
31 
36  protected $id;
37 
42  protected $type;
43 
48  protected $clientId;
49 
54  protected $anonymousId;
55 
60  protected $customer;
61 
66  protected $associate;
67 
68 
72  public function __construct(
73  ?bool $isPlatformClient = null,
74  ?string $id = null,
75  ?string $type = null,
76  ?string $clientId = null,
77  ?string $anonymousId = null,
78  ?Reference $customer = null,
79  ?Reference $associate = null
80  ) {
81  $this->isPlatformClient = $isPlatformClient;
82  $this->id = $id;
83  $this->type = $type;
84  $this->clientId = $clientId;
85  $this->anonymousId = $anonymousId;
86  $this->customer = $customer;
87  $this->associate = $associate;
88 
89  }
90 
97  public function getIsPlatformClient()
98  {
99  if (is_null($this->isPlatformClient)) {
101  $data = $this->raw(self::FIELD_IS_PLATFORM_CLIENT);
102  if (is_null($data)) {
103  return null;
104  }
105  $this->isPlatformClient = (bool) $data;
106  }
107 
109  }
110 
118  public function getId()
119  {
120  if (is_null($this->id)) {
122  $data = $this->raw(self::FIELD_ID);
123  if (is_null($data)) {
124  return null;
125  }
126  $this->id = (string) $data;
127  }
128 
129  return $this->id;
130  }
131 
143  public function getType()
144  {
145  if (is_null($this->type)) {
147  $data = $this->raw(self::FIELD_TYPE);
148  if (is_null($data)) {
149  return null;
150  }
151  $this->type = (string) $data;
152  }
153 
154  return $this->type;
155  }
156 
164  public function getClientId()
165  {
166  if (is_null($this->clientId)) {
168  $data = $this->raw(self::FIELD_CLIENT_ID);
169  if (is_null($data)) {
170  return null;
171  }
172  $this->clientId = (string) $data;
173  }
174 
175  return $this->clientId;
176  }
177 
184  public function getAnonymousId()
185  {
186  if (is_null($this->anonymousId)) {
188  $data = $this->raw(self::FIELD_ANONYMOUS_ID);
189  if (is_null($data)) {
190  return null;
191  }
192  $this->anonymousId = (string) $data;
193  }
194 
195  return $this->anonymousId;
196  }
197 
205  public function getCustomer()
206  {
207  if (is_null($this->customer)) {
209  $data = $this->raw(self::FIELD_CUSTOMER);
210  if (is_null($data)) {
211  return null;
212  }
213 
214  $this->customer = ReferenceModel::of($data);
215  }
216 
217  return $this->customer;
218  }
219 
226  public function getAssociate()
227  {
228  if (is_null($this->associate)) {
230  $data = $this->raw(self::FIELD_ASSOCIATE);
231  if (is_null($data)) {
232  return null;
233  }
234 
235  $this->associate = ReferenceModel::of($data);
236  }
237 
238  return $this->associate;
239  }
240 
241 
245  public function setIsPlatformClient(?bool $isPlatformClient): void
246  {
247  $this->isPlatformClient = $isPlatformClient;
248  }
249 
253  public function setId(?string $id): void
254  {
255  $this->id = $id;
256  }
257 
261  public function setType(?string $type): void
262  {
263  $this->type = $type;
264  }
265 
269  public function setClientId(?string $clientId): void
270  {
271  $this->clientId = $clientId;
272  }
273 
277  public function setAnonymousId(?string $anonymousId): void
278  {
279  $this->anonymousId = $anonymousId;
280  }
281 
285  public function setCustomer(?Reference $customer): void
286  {
287  $this->customer = $customer;
288  }
289 
293  public function setAssociate(?Reference $associate): void
294  {
295  $this->associate = $associate;
296  }
297 
298 
299 
300 }
__construct(?bool $isPlatformClient=null, ?string $id=null, ?string $type=null, ?string $clientId=null, ?string $anonymousId=null, ?Reference $customer=null, ?Reference $associate=null)