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
ImageModel.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
ImageModel
extends
JsonObjectModel
implements
Image
21
{
26
protected
$url
;
27
32
protected
$dimensions
;
33
38
protected
$label
;
39
40
44
public
function
__construct
(
45
?
string
$url
=
null
,
46
?
AssetDimensions
$dimensions
=
null
,
47
?
string
$label
=
null
48
) {
49
$this->url =
$url
;
50
$this->dimensions =
$dimensions
;
51
$this->label =
$label
;
52
}
53
60
public
function
getUrl
()
61
{
62
if
(is_null($this->url)) {
64
$data = $this->
raw
(self::FIELD_URL);
65
if
(is_null($data)) {
66
return
null
;
67
}
68
$this->url = (string) $data;
69
}
70
71
return
$this->url
;
72
}
73
80
public
function
getDimensions
()
81
{
82
if
(is_null($this->dimensions)) {
84
$data = $this->
raw
(self::FIELD_DIMENSIONS);
85
if
(is_null($data)) {
86
return
null
;
87
}
88
89
$this->dimensions =
AssetDimensionsModel::of
($data);
90
}
91
92
return
$this->dimensions
;
93
}
94
101
public
function
getLabel
()
102
{
103
if
(is_null($this->label)) {
105
$data = $this->
raw
(self::FIELD_LABEL);
106
if
(is_null($data)) {
107
return
null
;
108
}
109
$this->label = (string) $data;
110
}
111
112
return
$this->label
;
113
}
114
115
119
public
function
setUrl
(?
string
$url
): void
120
{
121
$this->url =
$url
;
122
}
123
127
public
function
setDimensions
(?
AssetDimensions
$dimensions
): void
128
{
129
$this->dimensions =
$dimensions
;
130
}
131
135
public
function
setLabel
(?
string
$label
): void
136
{
137
$this->label =
$label
;
138
}
139
}
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\ImageModel
Definition:
ImageModel.php:21
Commercetools\Import\Models\Common\ImageModel\getLabel
getLabel()
Definition:
ImageModel.php:101
Commercetools\Import\Models\Common\ImageModel\$label
$label
Definition:
ImageModel.php:38
Commercetools\Import\Models\Common\ImageModel\getUrl
getUrl()
Definition:
ImageModel.php:60
Commercetools\Import\Models\Common\ImageModel\$url
$url
Definition:
ImageModel.php:26
Commercetools\Import\Models\Common\ImageModel\__construct
__construct(?string $url=null, ?AssetDimensions $dimensions=null, ?string $label=null)
Definition:
ImageModel.php:44
Commercetools\Import\Models\Common\ImageModel\setDimensions
setDimensions(?AssetDimensions $dimensions)
Definition:
ImageModel.php:127
Commercetools\Import\Models\Common\ImageModel\getDimensions
getDimensions()
Definition:
ImageModel.php:80
Commercetools\Import\Models\Common\ImageModel\setLabel
setLabel(?string $label)
Definition:
ImageModel.php:135
Commercetools\Import\Models\Common\ImageModel\setUrl
setUrl(?string $url)
Definition:
ImageModel.php:119
Commercetools\Import\Models\Common\ImageModel\$dimensions
$dimensions
Definition:
ImageModel.php:32
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Import\Models\Common\AssetDimensions
Definition:
AssetDimensions.php:15
Commercetools\Import\Models\Common\Image
Definition:
Image.php:15
Commercetools\Import\Models\Common
Definition:
Address.php:9
Generated by
1.9.1