commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ProductSearchResultModel.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
28 protected $id;
29
35
41
42
46 public function __construct(
47 ?string $id = null,
50 ) {
51 $this->id = $id;
52 $this->matchingVariants = $matchingVariants;
53 $this->productProjection = $productProjection;
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
83 public function getMatchingVariants()
84 {
85 if (is_null($this->matchingVariants)) {
87 $data = $this->raw(self::FIELD_MATCHING_VARIANTS);
88 if (is_null($data)) {
89 return null;
90 }
91
92 $this->matchingVariants = ProductSearchMatchingVariantsModel::of($data);
93 }
94
96 }
97
105 public function getProductProjection()
106 {
107 if (is_null($this->productProjection)) {
109 $data = $this->raw(self::FIELD_PRODUCT_PROJECTION);
110 if (is_null($data)) {
111 return null;
112 }
113
114 $this->productProjection = ProductProjectionModel::of($data);
115 }
116
118 }
119
120
124 public function setId(?string $id): void
125 {
126 $this->id = $id;
127 }
128
133 {
134 $this->matchingVariants = $matchingVariants;
135 }
136
141 {
142 $this->productProjection = $productProjection;
143 }
144}
__construct(?string $id=null, ?ProductSearchMatchingVariants $matchingVariants=null, ?ProductProjection $productProjection=null)
setMatchingVariants(?ProductSearchMatchingVariants $matchingVariants)