commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-import
src
Models
Importrequests
OrderImportRequestModel.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\Orders\OrderImportCollection
;
16
use stdClass;
17
21
final
class
OrderImportRequestModel
extends
JsonObjectModel
implements
OrderImportRequest
22
{
23
public
const
DISCRIMINATOR_VALUE
=
'order'
;
28
protected
$type
;
29
34
protected
$resources
;
35
36
40
public
function
__construct
(
41
?
OrderImportCollection
$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 =
OrderImportCollection::fromArray
($data);
83
}
84
85
return
$this->resources
;
86
}
87
88
92
public
function
setResources
(?
OrderImportCollection
$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\Importrequests\OrderImportRequestModel
Definition:
OrderImportRequestModel.php:22
Commercetools\Import\Models\Importrequests\OrderImportRequestModel\getType
getType()
Definition:
OrderImportRequestModel.php:54
Commercetools\Import\Models\Importrequests\OrderImportRequestModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
OrderImportRequestModel.php:23
Commercetools\Import\Models\Importrequests\OrderImportRequestModel\setResources
setResources(?OrderImportCollection $resources)
Definition:
OrderImportRequestModel.php:92
Commercetools\Import\Models\Importrequests\OrderImportRequestModel\$resources
$resources
Definition:
OrderImportRequestModel.php:34
Commercetools\Import\Models\Importrequests\OrderImportRequestModel\__construct
__construct(?OrderImportCollection $resources=null, ?string $type=null)
Definition:
OrderImportRequestModel.php:40
Commercetools\Import\Models\Importrequests\OrderImportRequestModel\getResources
getResources()
Definition:
OrderImportRequestModel.php:74
Commercetools\Import\Models\Importrequests\OrderImportRequestModel\$type
$type
Definition:
OrderImportRequestModel.php:28
Commercetools\Import\Models\Orders\OrderImportCollection
Definition:
OrderImportCollection.php:22
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Import\Models\Importrequests\OrderImportRequest
Definition:
OrderImportRequest.php:16
Commercetools\Import\Models\Importrequests
Definition:
CategoryImportRequest.php:9
Generated by
1.9.1