commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-history
src
Models
Change
RemoveAssociateChangeModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\History\Models\Change
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
15
use stdClass;
16
use
Commercetools\History\Models\Common\Associate
;
17
use
Commercetools\History\Models\Common\AssociateModel
;
18
22
final
class
RemoveAssociateChangeModel
extends
JsonObjectModel
implements
RemoveAssociateChange
23
{
24
25
public
const
DISCRIMINATOR_VALUE
=
'RemoveAssociateChange'
;
30
protected
$type
;
31
36
protected
$change
;
37
42
protected
$previousValue
;
43
44
48
public
function
__construct
(
49
?
string
$change
=
null
,
50
?
Associate
$previousValue
=
null
,
51
?
string
$type
=
null
52
) {
53
$this->change =
$change
;
54
$this->previousValue =
$previousValue
;
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
getPreviousValue
()
101
{
102
if
(is_null($this->previousValue)) {
104
$data = $this->
raw
(self::FIELD_PREVIOUS_VALUE);
105
if
(is_null($data)) {
106
return
null
;
107
}
108
109
$this->previousValue =
AssociateModel::of
($data);
110
}
111
112
return
$this->previousValue
;
113
}
114
115
119
public
function
setChange
(?
string
$change
): void
120
{
121
$this->change =
$change
;
122
}
123
127
public
function
setPreviousValue
(?
Associate
$previousValue
): void
128
{
129
$this->previousValue =
$previousValue
;
130
}
131
132
133
134
}
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition:
BaseJsonObject.php:57
Commercetools\Base\BaseJsonObject\of
static of($data=null)
Definition:
BaseJsonObject.php:26
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\History\Models\Change\RemoveAssociateChangeModel
Definition:
RemoveAssociateChangeModel.php:23
Commercetools\History\Models\Change\RemoveAssociateChangeModel\getType
getType()
Definition:
RemoveAssociateChangeModel.php:62
Commercetools\History\Models\Change\RemoveAssociateChangeModel\setChange
setChange(?string $change)
Definition:
RemoveAssociateChangeModel.php:119
Commercetools\History\Models\Change\RemoveAssociateChangeModel\getPreviousValue
getPreviousValue()
Definition:
RemoveAssociateChangeModel.php:100
Commercetools\History\Models\Change\RemoveAssociateChangeModel\getChange
getChange()
Definition:
RemoveAssociateChangeModel.php:80
Commercetools\History\Models\Change\RemoveAssociateChangeModel\__construct
__construct(?string $change=null, ?Associate $previousValue=null, ?string $type=null)
Definition:
RemoveAssociateChangeModel.php:48
Commercetools\History\Models\Change\RemoveAssociateChangeModel\$type
$type
Definition:
RemoveAssociateChangeModel.php:30
Commercetools\History\Models\Change\RemoveAssociateChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
RemoveAssociateChangeModel.php:25
Commercetools\History\Models\Change\RemoveAssociateChangeModel\$previousValue
$previousValue
Definition:
RemoveAssociateChangeModel.php:42
Commercetools\History\Models\Change\RemoveAssociateChangeModel\setPreviousValue
setPreviousValue(?Associate $previousValue)
Definition:
RemoveAssociateChangeModel.php:127
Commercetools\History\Models\Change\RemoveAssociateChangeModel\$change
$change
Definition:
RemoveAssociateChangeModel.php:36
Commercetools\History\Models\Common\AssociateModel
Definition:
AssociateModel.php:21
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\History\Models\Change\RemoveAssociateChange
Definition:
RemoveAssociateChange.php:16
Commercetools\History\Models\Common\Associate
Definition:
Associate.php:15
Commercetools\History\Models\Change
Definition:
AddAddressChange.php:9
Generated by
1.9.1