commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-api
src
Models
Project
SearchIndexingConfigurationValuesModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Project
;
10
11
use
Commercetools\Api\Models\Common\LastModifiedBy
;
12
use
Commercetools\Api\Models\Common\LastModifiedByModel
;
13
use
Commercetools\Base\DateTimeImmutableCollection
;
14
use
Commercetools\Base\JsonObject
;
15
use
Commercetools\Base\JsonObjectModel
;
16
use
Commercetools\Base\MapperFactory
;
17
use DateTimeImmutable;
18
use stdClass;
19
23
final
class
SearchIndexingConfigurationValuesModel
extends
JsonObjectModel
implements
SearchIndexingConfigurationValues
24
{
29
protected
$status
;
30
35
protected
$lastModifiedAt
;
36
41
protected
$lastModifiedBy
;
42
43
47
public
function
__construct
(
48
?
string
$status
=
null
,
49
?DateTimeImmutable
$lastModifiedAt
=
null
,
50
?
LastModifiedBy
$lastModifiedBy
=
null
51
) {
52
$this->status =
$status
;
53
$this->lastModifiedAt =
$lastModifiedAt
;
54
$this->lastModifiedBy =
$lastModifiedBy
;
55
}
56
63
public
function
getStatus
()
64
{
65
if
(is_null($this->status)) {
67
$data = $this->
raw
(self::FIELD_STATUS);
68
if
(is_null($data)) {
69
return
null
;
70
}
71
$this->status = (string) $data;
72
}
73
74
return
$this->status
;
75
}
76
83
public
function
getLastModifiedAt
()
84
{
85
if
(is_null($this->lastModifiedAt)) {
87
$data = $this->
raw
(self::FIELD_LAST_MODIFIED_AT);
88
if
(is_null($data)) {
89
return
null
;
90
}
91
$data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data);
92
if
(
false
=== $data) {
93
return
null
;
94
}
95
$this->lastModifiedAt = $data;
96
}
97
98
return
$this->lastModifiedAt
;
99
}
100
107
public
function
getLastModifiedBy
()
108
{
109
if
(is_null($this->lastModifiedBy)) {
111
$data = $this->
raw
(self::FIELD_LAST_MODIFIED_BY);
112
if
(is_null($data)) {
113
return
null
;
114
}
115
116
$this->lastModifiedBy = LastModifiedByModel::of($data);
117
}
118
119
return
$this->lastModifiedBy
;
120
}
121
122
126
public
function
setStatus
(?
string
$status
): void
127
{
128
$this->status =
$status
;
129
}
130
134
public
function
setLastModifiedAt
(?DateTimeImmutable
$lastModifiedAt
): void
135
{
136
$this->lastModifiedAt =
$lastModifiedAt
;
137
}
138
142
public
function
setLastModifiedBy
(?
LastModifiedBy
$lastModifiedBy
): void
143
{
144
$this->lastModifiedBy =
$lastModifiedBy
;
145
}
146
147
148
#[\ReturnTypeWillChange]
149
public
function
jsonSerialize
()
150
{
151
$data = $this->
toArray
();
152
if
(isset($data[
SearchIndexingConfigurationValues::FIELD_LAST_MODIFIED_AT
]) && $data[
SearchIndexingConfigurationValues::FIELD_LAST_MODIFIED_AT
] instanceof \DateTimeImmutable) {
153
$data[
SearchIndexingConfigurationValues::FIELD_LAST_MODIFIED_AT
] = $data[
SearchIndexingConfigurationValues::FIELD_LAST_MODIFIED_AT
]->setTimeZone(
new
\DateTimeZone(
'UTC'
))->format(
'c'
);
154
}
155
return
(
object
) $data;
156
}
157
}
Commercetools\Api\Models\Common\LastModifiedByModel
Definition
LastModifiedByModel.php:23
Commercetools\Api\Models\Project\SearchIndexingConfigurationValuesModel
Definition
SearchIndexingConfigurationValuesModel.php:24
Commercetools\Api\Models\Project\SearchIndexingConfigurationValuesModel\getLastModifiedBy
getLastModifiedBy()
Definition
SearchIndexingConfigurationValuesModel.php:107
Commercetools\Api\Models\Project\SearchIndexingConfigurationValuesModel\$lastModifiedBy
$lastModifiedBy
Definition
SearchIndexingConfigurationValuesModel.php:41
Commercetools\Api\Models\Project\SearchIndexingConfigurationValuesModel\getLastModifiedAt
getLastModifiedAt()
Definition
SearchIndexingConfigurationValuesModel.php:83
Commercetools\Api\Models\Project\SearchIndexingConfigurationValuesModel\setStatus
setStatus(?string $status)
Definition
SearchIndexingConfigurationValuesModel.php:126
Commercetools\Api\Models\Project\SearchIndexingConfigurationValuesModel\jsonSerialize
jsonSerialize()
Definition
SearchIndexingConfigurationValuesModel.php:149
Commercetools\Api\Models\Project\SearchIndexingConfigurationValuesModel\$status
$status
Definition
SearchIndexingConfigurationValuesModel.php:29
Commercetools\Api\Models\Project\SearchIndexingConfigurationValuesModel\setLastModifiedBy
setLastModifiedBy(?LastModifiedBy $lastModifiedBy)
Definition
SearchIndexingConfigurationValuesModel.php:142
Commercetools\Api\Models\Project\SearchIndexingConfigurationValuesModel\getStatus
getStatus()
Definition
SearchIndexingConfigurationValuesModel.php:63
Commercetools\Api\Models\Project\SearchIndexingConfigurationValuesModel\__construct
__construct(?string $status=null, ?DateTimeImmutable $lastModifiedAt=null, ?LastModifiedBy $lastModifiedBy=null)
Definition
SearchIndexingConfigurationValuesModel.php:47
Commercetools\Api\Models\Project\SearchIndexingConfigurationValuesModel\setLastModifiedAt
setLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
Definition
SearchIndexingConfigurationValuesModel.php:134
Commercetools\Api\Models\Project\SearchIndexingConfigurationValuesModel\$lastModifiedAt
$lastModifiedAt
Definition
SearchIndexingConfigurationValuesModel.php:35
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\JsonObjectModel\toArray
toArray()
Definition
JsonObjectModel.php:32
Commercetools\Base\MapperFactory
Definition
MapperFactory.php:16
Commercetools\Api\Models\Common\LastModifiedBy
Definition
LastModifiedBy.php:16
Commercetools\Api\Models\Project\SearchIndexingConfigurationValues
Definition
SearchIndexingConfigurationValues.php:17
Commercetools\Api\Models\Project\SearchIndexingConfigurationValues\FIELD_LAST_MODIFIED_AT
const FIELD_LAST_MODIFIED_AT
Definition
SearchIndexingConfigurationValues.php:19
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Project
Definition
BusinessUnitConfiguration.php:9
Generated by
1.9.8