commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Customer
CustomerSetCustomerGroupActionModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Customer
;
10
11
use
Commercetools\Api\Models\CustomerGroup\CustomerGroupResourceIdentifier
;
12
use
Commercetools\Api\Models\CustomerGroup\CustomerGroupResourceIdentifierModel
;
13
use
Commercetools\Base\DateTimeImmutableCollection
;
14
use
Commercetools\Base\JsonObject
;
15
use
Commercetools\Base\JsonObjectModel
;
16
use
Commercetools\Base\MapperFactory
;
17
use stdClass;
18
22
final
class
CustomerSetCustomerGroupActionModel
extends
JsonObjectModel
implements
CustomerSetCustomerGroupAction
23
{
24
public
const
DISCRIMINATOR_VALUE
=
'setCustomerGroup'
;
29
protected
$action
;
30
35
protected
$customerGroup
;
36
37
41
public
function
__construct
(
42
?
CustomerGroupResourceIdentifier
$customerGroup
=
null
,
43
?
string
$action
=
null
44
) {
45
$this->customerGroup =
$customerGroup
;
46
$this->action =
$action
??
self::DISCRIMINATOR_VALUE
;
47
}
48
53
public
function
getAction
()
54
{
55
if
(is_null($this->action)) {
57
$data = $this->
raw
(self::FIELD_ACTION);
58
if
(is_null($data)) {
59
return
null
;
60
}
61
$this->action = (string) $data;
62
}
63
64
return
$this->action
;
65
}
66
74
public
function
getCustomerGroup
()
75
{
76
if
(is_null($this->customerGroup)) {
78
$data = $this->
raw
(self::FIELD_CUSTOMER_GROUP);
79
if
(is_null($data)) {
80
return
null
;
81
}
82
83
$this->customerGroup =
CustomerGroupResourceIdentifierModel::of
($data);
84
}
85
86
return
$this->customerGroup
;
87
}
88
89
93
public
function
setCustomerGroup
(?
CustomerGroupResourceIdentifier
$customerGroup
): void
94
{
95
$this->customerGroup =
$customerGroup
;
96
}
97
}
Commercetools\Api\Models\Customer\CustomerSetCustomerGroupActionModel
Definition:
CustomerSetCustomerGroupActionModel.php:23
Commercetools\Api\Models\Customer\CustomerSetCustomerGroupActionModel\getAction
getAction()
Definition:
CustomerSetCustomerGroupActionModel.php:53
Commercetools\Api\Models\Customer\CustomerSetCustomerGroupActionModel\__construct
__construct(?CustomerGroupResourceIdentifier $customerGroup=null, ?string $action=null)
Definition:
CustomerSetCustomerGroupActionModel.php:41
Commercetools\Api\Models\Customer\CustomerSetCustomerGroupActionModel\$customerGroup
$customerGroup
Definition:
CustomerSetCustomerGroupActionModel.php:35
Commercetools\Api\Models\Customer\CustomerSetCustomerGroupActionModel\getCustomerGroup
getCustomerGroup()
Definition:
CustomerSetCustomerGroupActionModel.php:74
Commercetools\Api\Models\Customer\CustomerSetCustomerGroupActionModel\$action
$action
Definition:
CustomerSetCustomerGroupActionModel.php:29
Commercetools\Api\Models\Customer\CustomerSetCustomerGroupActionModel\setCustomerGroup
setCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup)
Definition:
CustomerSetCustomerGroupActionModel.php:93
Commercetools\Api\Models\Customer\CustomerSetCustomerGroupActionModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
CustomerSetCustomerGroupActionModel.php:24
Commercetools\Api\Models\CustomerGroup\CustomerGroupResourceIdentifierModel
Definition:
CustomerGroupResourceIdentifierModel.php:23
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\Api\Models\Customer\CustomerSetCustomerGroupAction
Definition:
CustomerSetCustomerGroupAction.php:16
Commercetools\Api\Models\CustomerGroup\CustomerGroupResourceIdentifier
Definition:
CustomerGroupResourceIdentifier.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Customer
Definition:
Customer.php:9
Generated by
1.9.1