commercetools-sdk-php-v2
master
The platform, import-api and ml-api PHP sdks generated from our api reference.
lib
commercetools-import
src
Models
Common
AssetSourceModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Import\Models\Common
;
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
20
final
class
AssetSourceModel
extends
JsonObjectModel
implements
AssetSource
21
{
26
protected
$uri
;
27
32
protected
$key
;
33
38
protected
$dimensions
;
39
44
protected
$contentType
;
45
46
50
public
function
__construct
(
51
?
string
$uri
=
null
,
52
?
string
$key
=
null
,
53
?
AssetDimensions
$dimensions
=
null
,
54
?
string
$contentType
=
null
55
) {
56
$this->uri =
$uri
;
57
$this->key =
$key
;
58
$this->dimensions =
$dimensions
;
59
$this->contentType =
$contentType
;
60
}
61
66
public
function
getUri
()
67
{
68
if
(is_null($this->uri)) {
70
$data = $this->
raw
(self::FIELD_URI);
71
if
(is_null($data)) {
72
return
null
;
73
}
74
$this->uri = (string) $data;
75
}
76
77
return
$this->uri
;
78
}
79
84
public
function
getKey
()
85
{
86
if
(is_null($this->key)) {
88
$data = $this->
raw
(self::FIELD_KEY);
89
if
(is_null($data)) {
90
return
null
;
91
}
92
$this->key = (string) $data;
93
}
94
95
return
$this->key
;
96
}
97
104
public
function
getDimensions
()
105
{
106
if
(is_null($this->dimensions)) {
108
$data = $this->
raw
(self::FIELD_DIMENSIONS);
109
if
(is_null($data)) {
110
return
null
;
111
}
112
113
$this->dimensions =
AssetDimensionsModel::of
($data);
114
}
115
116
return
$this->dimensions
;
117
}
118
123
public
function
getContentType
()
124
{
125
if
(is_null($this->contentType)) {
127
$data = $this->
raw
(self::FIELD_CONTENT_TYPE);
128
if
(is_null($data)) {
129
return
null
;
130
}
131
$this->contentType = (string) $data;
132
}
133
134
return
$this->contentType
;
135
}
136
137
141
public
function
setUri
(?
string
$uri
): void
142
{
143
$this->uri =
$uri
;
144
}
145
149
public
function
setKey
(?
string
$key
): void
150
{
151
$this->key =
$key
;
152
}
153
157
public
function
setDimensions
(?
AssetDimensions
$dimensions
): void
158
{
159
$this->dimensions =
$dimensions
;
160
}
161
165
public
function
setContentType
(?
string
$contentType
): void
166
{
167
$this->contentType =
$contentType
;
168
}
169
}
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\Import\Models\Common\AssetSourceModel
Definition:
AssetSourceModel.php:21
Commercetools\Import\Models\Common\AssetSourceModel\getKey
getKey()
Definition:
AssetSourceModel.php:84
Commercetools\Import\Models\Common\AssetSourceModel\setKey
setKey(?string $key)
Definition:
AssetSourceModel.php:149
Commercetools\Import\Models\Common\AssetSourceModel\setContentType
setContentType(?string $contentType)
Definition:
AssetSourceModel.php:165
Commercetools\Import\Models\Common\AssetSourceModel\getUri
getUri()
Definition:
AssetSourceModel.php:66
Commercetools\Import\Models\Common\AssetSourceModel\getContentType
getContentType()
Definition:
AssetSourceModel.php:123
Commercetools\Import\Models\Common\AssetSourceModel\setUri
setUri(?string $uri)
Definition:
AssetSourceModel.php:141
Commercetools\Import\Models\Common\AssetSourceModel\__construct
__construct(?string $uri=null, ?string $key=null, ?AssetDimensions $dimensions=null, ?string $contentType=null)
Definition:
AssetSourceModel.php:50
Commercetools\Import\Models\Common\AssetSourceModel\setDimensions
setDimensions(?AssetDimensions $dimensions)
Definition:
AssetSourceModel.php:157
Commercetools\Import\Models\Common\AssetSourceModel\$dimensions
$dimensions
Definition:
AssetSourceModel.php:38
Commercetools\Import\Models\Common\AssetSourceModel\$uri
$uri
Definition:
AssetSourceModel.php:26
Commercetools\Import\Models\Common\AssetSourceModel\getDimensions
getDimensions()
Definition:
AssetSourceModel.php:104
Commercetools\Import\Models\Common\AssetSourceModel\$key
$key
Definition:
AssetSourceModel.php:32
Commercetools\Import\Models\Common\AssetSourceModel\$contentType
$contentType
Definition:
AssetSourceModel.php:44
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Import\Models\Common\AssetDimensions
Definition:
AssetDimensions.php:15
Commercetools\Import\Models\Common\AssetSource
Definition:
AssetSource.php:15
Commercetools\Import\Models\Common
Definition:
Address.php:9
Generated by
1.9.1