commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
AddAddressChangeModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
18 
23 {
24 
25  public const DISCRIMINATOR_VALUE = 'AddAddressChange';
30  protected $type;
31 
36  protected $change;
37 
42  protected $nextValue;
43 
44 
48  public function __construct(
49  ?string $change = null,
50  ?Address $nextValue = null,
51  ?string $type = null
52  ) {
53  $this->change = $change;
54  $this->nextValue = $nextValue;
55  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
56  }
57 
62  public function getType()
63  {
64  if (is_null($this->type)) {
66  $data = $this->raw(self::FIELD_TYPE);
67  if (is_null($data)) {
68  return null;
69  }
70  $this->type = (string) $data;
71  }
72 
73  return $this->type;
74  }
75 
80  public function getChange()
81  {
82  if (is_null($this->change)) {
84  $data = $this->raw(self::FIELD_CHANGE);
85  if (is_null($data)) {
86  return null;
87  }
88  $this->change = (string) $data;
89  }
90 
91  return $this->change;
92  }
93 
100  public function getNextValue()
101  {
102  if (is_null($this->nextValue)) {
104  $data = $this->raw(self::FIELD_NEXT_VALUE);
105  if (is_null($data)) {
106  return null;
107  }
108 
109  $this->nextValue = AddressModel::of($data);
110  }
111 
112  return $this->nextValue;
113  }
114 
115 
119  public function setChange(?string $change): void
120  {
121  $this->change = $change;
122  }
123 
127  public function setNextValue(?Address $nextValue): void
128  {
129  $this->nextValue = $nextValue;
130  }
131 
132 
133 
134 }
__construct(?string $change=null, ?Address $nextValue=null, ?string $type=null)