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
ProductSearch
ProductSearchResultModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\ProductSearch
;
10
11
use
Commercetools\Api\Models\Product\ProductProjection
;
12
use
Commercetools\Api\Models\Product\ProductProjectionModel
;
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
ProductSearchResultModel
extends
JsonObjectModel
implements
ProductSearchResult
23
{
28
protected
$id
;
29
34
protected
$productProjection
;
35
40
protected
$matchingVariants
;
41
42
46
public
function
__construct
(
47
?
string
$id
=
null
,
48
?
ProductProjection
$productProjection
=
null
,
49
?
ProductSearchMatchingVariants
$matchingVariants
=
null
50
) {
51
$this->
id
=
$id
;
52
$this->productProjection =
$productProjection
;
53
$this->matchingVariants =
$matchingVariants
;
54
}
55
62
public
function
getId
()
63
{
64
if
(is_null($this->
id
)) {
66
$data = $this->
raw
(self::FIELD_ID);
67
if
(is_null($data)) {
68
return
null
;
69
}
70
$this->
id
= (string) $data;
71
}
72
73
return
$this->id
;
74
}
75
82
public
function
getProductProjection
()
83
{
84
if
(is_null($this->productProjection)) {
86
$data = $this->
raw
(self::FIELD_PRODUCT_PROJECTION);
87
if
(is_null($data)) {
88
return
null
;
89
}
90
91
$this->productProjection = ProductProjectionModel::of($data);
92
}
93
94
return
$this->productProjection
;
95
}
96
103
public
function
getMatchingVariants
()
104
{
105
if
(is_null($this->matchingVariants)) {
107
$data = $this->
raw
(self::FIELD_MATCHING_VARIANTS);
108
if
(is_null($data)) {
109
return
null
;
110
}
111
112
$this->matchingVariants =
ProductSearchMatchingVariantsModel::of
($data);
113
}
114
115
return
$this->matchingVariants
;
116
}
117
118
122
public
function
setId
(?
string
$id
): void
123
{
124
$this->
id
=
$id
;
125
}
126
130
public
function
setProductProjection
(?
ProductProjection
$productProjection
): void
131
{
132
$this->productProjection =
$productProjection
;
133
}
134
138
public
function
setMatchingVariants
(?
ProductSearchMatchingVariants
$matchingVariants
): void
139
{
140
$this->matchingVariants =
$matchingVariants
;
141
}
142
}
Commercetools\Api\Models\Product\ProductProjectionModel
Definition
ProductProjectionModel.php:35
Commercetools\Api\Models\ProductSearch\ProductSearchResultModel
Definition
ProductSearchResultModel.php:23
Commercetools\Api\Models\ProductSearch\ProductSearchResultModel\$id
$id
Definition
ProductSearchResultModel.php:28
Commercetools\Api\Models\ProductSearch\ProductSearchResultModel\setProductProjection
setProductProjection(?ProductProjection $productProjection)
Definition
ProductSearchResultModel.php:130
Commercetools\Api\Models\ProductSearch\ProductSearchResultModel\$productProjection
$productProjection
Definition
ProductSearchResultModel.php:34
Commercetools\Api\Models\ProductSearch\ProductSearchResultModel\getMatchingVariants
getMatchingVariants()
Definition
ProductSearchResultModel.php:103
Commercetools\Api\Models\ProductSearch\ProductSearchResultModel\getId
getId()
Definition
ProductSearchResultModel.php:62
Commercetools\Api\Models\ProductSearch\ProductSearchResultModel\setMatchingVariants
setMatchingVariants(?ProductSearchMatchingVariants $matchingVariants)
Definition
ProductSearchResultModel.php:138
Commercetools\Api\Models\ProductSearch\ProductSearchResultModel\__construct
__construct(?string $id=null, ?ProductProjection $productProjection=null, ?ProductSearchMatchingVariants $matchingVariants=null)
Definition
ProductSearchResultModel.php:46
Commercetools\Api\Models\ProductSearch\ProductSearchResultModel\getProductProjection
getProductProjection()
Definition
ProductSearchResultModel.php:82
Commercetools\Api\Models\ProductSearch\ProductSearchResultModel\setId
setId(?string $id)
Definition
ProductSearchResultModel.php:122
Commercetools\Api\Models\ProductSearch\ProductSearchResultModel\$matchingVariants
$matchingVariants
Definition
ProductSearchResultModel.php:40
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\Api\Models\Product\ProductProjection
Definition
ProductProjection.php:23
Commercetools\Api\Models\ProductSearch\ProductSearchMatchingVariants
Definition
ProductSearchMatchingVariants.php:15
Commercetools\Api\Models\ProductSearch\ProductSearchResult
Definition
ProductSearchResult.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\ProductSearch
Definition
ProductPagedSearchResponse.php:9
Generated by
1.9.8