commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Extension
ExtensionInputModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Extension
;
10
11
use
Commercetools\Api\Models\Common\Reference
;
12
use
Commercetools\Api\Models\Common\ReferenceModel
;
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
ExtensionInputModel
extends
JsonObjectModel
implements
ExtensionInput
23
{
28
protected
$action
;
29
34
protected
$resource
;
35
36
40
public
function
__construct
(
41
?
string
$action
=
null
,
42
?
Reference
$resource
=
null
43
) {
44
$this->action =
$action
;
45
$this->resource =
$resource
;
46
}
47
54
public
function
getAction
()
55
{
56
if
(is_null($this->action)) {
58
$data = $this->
raw
(self::FIELD_ACTION);
59
if
(is_null($data)) {
60
return
null
;
61
}
62
$this->action = (string) $data;
63
}
64
65
return
$this->action
;
66
}
67
74
public
function
getResource
()
75
{
76
if
(is_null($this->resource)) {
78
$data = $this->
raw
(self::FIELD_RESOURCE);
79
if
(is_null($data)) {
80
return
null
;
81
}
82
$className =
ReferenceModel::resolveDiscriminatorClass
($data);
83
$this->resource = $className::of($data);
84
}
85
86
return
$this->resource
;
87
}
88
89
93
public
function
setAction
(?
string
$action
): void
94
{
95
$this->action =
$action
;
96
}
97
101
public
function
setResource
(?
Reference
$resource
): void
102
{
103
$this->resource =
$resource
;
104
}
105
}
Commercetools\Api\Models\Common\ReferenceModel
Definition:
ReferenceModel.php:91
Commercetools\Api\Models\Common\ReferenceModel\resolveDiscriminatorClass
static resolveDiscriminatorClass($value)
Definition:
ReferenceModel.php:213
Commercetools\Api\Models\Extension\ExtensionInputModel
Definition:
ExtensionInputModel.php:23
Commercetools\Api\Models\Extension\ExtensionInputModel\$action
$action
Definition:
ExtensionInputModel.php:28
Commercetools\Api\Models\Extension\ExtensionInputModel\setAction
setAction(?string $action)
Definition:
ExtensionInputModel.php:93
Commercetools\Api\Models\Extension\ExtensionInputModel\$resource
$resource
Definition:
ExtensionInputModel.php:34
Commercetools\Api\Models\Extension\ExtensionInputModel\setResource
setResource(?Reference $resource)
Definition:
ExtensionInputModel.php:101
Commercetools\Api\Models\Extension\ExtensionInputModel\__construct
__construct(?string $action=null, ?Reference $resource=null)
Definition:
ExtensionInputModel.php:40
Commercetools\Api\Models\Extension\ExtensionInputModel\getAction
getAction()
Definition:
ExtensionInputModel.php:54
Commercetools\Api\Models\Extension\ExtensionInputModel\getResource
getResource()
Definition:
ExtensionInputModel.php:74
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\Api\Models\Common\Reference
Definition:
Reference.php:50
Commercetools\Api\Models\Extension\ExtensionInput
Definition:
ExtensionInput.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Extension
Definition:
AuthorizationHeaderAuthentication.php:9
Generated by
1.9.1