commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
SearchAnyValueModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
20 final class SearchAnyValueModel extends JsonObjectModel implements SearchAnyValue
21 {
26  protected $field;
27 
32  protected $boost;
33 
38  protected $fieldType;
39 
44  protected $value;
45 
50  protected $language;
51 
56  protected $caseInsensitive;
57 
58 
62  public function __construct(
63  ?string $field = null,
64  ?float $boost = null,
65  ?string $fieldType = null,
66  $value = null,
67  ?string $language = null,
68  ?bool $caseInsensitive = null
69  ) {
70  $this->field = $field;
71  $this->boost = $boost;
72  $this->fieldType = $fieldType;
73  $this->value = $value;
74  $this->language = $language;
75  $this->caseInsensitive = $caseInsensitive;
76  }
77 
82  public function getField()
83  {
84  if (is_null($this->field)) {
86  $data = $this->raw(self::FIELD_FIELD);
87  if (is_null($data)) {
88  return null;
89  }
90  $this->field = (string) $data;
91  }
92 
93  return $this->field;
94  }
95 
100  public function getBoost()
101  {
102  if (is_null($this->boost)) {
104  $data = $this->raw(self::FIELD_BOOST);
105  if (is_null($data)) {
106  return null;
107  }
108  $this->boost = (float) $data;
109  }
110 
111  return $this->boost;
112  }
113 
120  public function getFieldType()
121  {
122  if (is_null($this->fieldType)) {
124  $data = $this->raw(self::FIELD_FIELD_TYPE);
125  if (is_null($data)) {
126  return null;
127  }
128  $this->fieldType = (string) $data;
129  }
130 
131  return $this->fieldType;
132  }
133 
138  public function getValue()
139  {
140  if (is_null($this->value)) {
142  $data = $this->raw(self::FIELD_VALUE);
143  if (is_null($data)) {
144  return null;
145  }
146  $this->value = $data;
147  }
148 
149  return $this->value;
150  }
151 
158  public function getLanguage()
159  {
160  if (is_null($this->language)) {
162  $data = $this->raw(self::FIELD_LANGUAGE);
163  if (is_null($data)) {
164  return null;
165  }
166  $this->language = (string) $data;
167  }
168 
169  return $this->language;
170  }
171 
176  public function getCaseInsensitive()
177  {
178  if (is_null($this->caseInsensitive)) {
180  $data = $this->raw(self::FIELD_CASE_INSENSITIVE);
181  if (is_null($data)) {
182  return null;
183  }
184  $this->caseInsensitive = (bool) $data;
185  }
186 
187  return $this->caseInsensitive;
188  }
189 
190 
194  public function setField(?string $field): void
195  {
196  $this->field = $field;
197  }
198 
202  public function setBoost(?float $boost): void
203  {
204  $this->boost = $boost;
205  }
206 
210  public function setFieldType(?string $fieldType): void
211  {
212  $this->fieldType = $fieldType;
213  }
214 
218  public function setValue($value): void
219  {
220  $this->value = $value;
221  }
222 
226  public function setLanguage(?string $language): void
227  {
228  $this->language = $language;
229  }
230 
234  public function setCaseInsensitive(?bool $caseInsensitive): void
235  {
236  $this->caseInsensitive = $caseInsensitive;
237  }
238 }
__construct(?string $field=null, ?float $boost=null, ?string $fieldType=null, $value=null, ?string $language=null, ?bool $caseInsensitive=null)