commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-import
src
Models
Importrequests
CustomerImportRequestModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Import\Models\Importrequests
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
15
use
Commercetools\Import\Models\Customers\CustomerImportCollection
;
16
use stdClass;
17
21
final
class
CustomerImportRequestModel
extends
JsonObjectModel
implements
CustomerImportRequest
22
{
23
public
const
DISCRIMINATOR_VALUE
=
'customer'
;
28
protected
$type
;
29
34
protected
$resources
;
35
36
40
public
function
__construct
(
41
?
CustomerImportCollection
$resources
=
null
,
42
?
string
$type
=
null
43
) {
44
$this->resources =
$resources
;
45
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
46
}
47
54
public
function
getType
()
55
{
56
if
(is_null($this->type)) {
58
$data = $this->
raw
(self::FIELD_TYPE);
59
if
(is_null($data)) {
60
return
null
;
61
}
62
$this->type = (string) $data;
63
}
64
65
return
$this->type
;
66
}
67
74
public
function
getResources
()
75
{
76
if
(is_null($this->resources)) {
78
$data = $this->
raw
(self::FIELD_RESOURCES);
79
if
(is_null($data)) {
80
return
null
;
81
}
82
$this->resources =
CustomerImportCollection::fromArray
($data);
83
}
84
85
return
$this->resources
;
86
}
87
88
92
public
function
setResources
(?
CustomerImportCollection
$resources
): void
93
{
94
$this->resources =
$resources
;
95
}
96
}
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition:
BaseJsonObject.php:57
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\Base\MapperSequence\fromArray
static fromArray(array $data)
Definition:
MapperSequence.php:56
Commercetools\Import\Models\Customers\CustomerImportCollection
Definition:
CustomerImportCollection.php:22
Commercetools\Import\Models\Importrequests\CustomerImportRequestModel
Definition:
CustomerImportRequestModel.php:22
Commercetools\Import\Models\Importrequests\CustomerImportRequestModel\$type
$type
Definition:
CustomerImportRequestModel.php:28
Commercetools\Import\Models\Importrequests\CustomerImportRequestModel\getResources
getResources()
Definition:
CustomerImportRequestModel.php:74
Commercetools\Import\Models\Importrequests\CustomerImportRequestModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
CustomerImportRequestModel.php:23
Commercetools\Import\Models\Importrequests\CustomerImportRequestModel\setResources
setResources(?CustomerImportCollection $resources)
Definition:
CustomerImportRequestModel.php:92
Commercetools\Import\Models\Importrequests\CustomerImportRequestModel\$resources
$resources
Definition:
CustomerImportRequestModel.php:34
Commercetools\Import\Models\Importrequests\CustomerImportRequestModel\__construct
__construct(?CustomerImportCollection $resources=null, ?string $type=null)
Definition:
CustomerImportRequestModel.php:40
Commercetools\Import\Models\Importrequests\CustomerImportRequestModel\getType
getType()
Definition:
CustomerImportRequestModel.php:54
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Import\Models\Importrequests\CustomerImportRequest
Definition:
CustomerImportRequest.php:16
Commercetools\Import\Models\Importrequests
Definition:
CategoryImportRequest.php:9
Generated by
1.9.1