commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
SearchKeywordModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
20 final class SearchKeywordModel extends JsonObjectModel implements SearchKeyword
21 {
26  protected $text;
27 
32  protected $suggestTokenizer;
33 
34 
38  public function __construct(
39  ?string $text = null,
41  ) {
42  $this->text = $text;
43  $this->suggestTokenizer = $suggestTokenizer;
44  }
45 
50  public function getText()
51  {
52  if (is_null($this->text)) {
54  $data = $this->raw(self::FIELD_TEXT);
55  if (is_null($data)) {
56  return null;
57  }
58  $this->text = (string) $data;
59  }
60 
61  return $this->text;
62  }
63 
70  public function getSuggestTokenizer()
71  {
72  if (is_null($this->suggestTokenizer)) {
74  $data = $this->raw(self::FIELD_SUGGEST_TOKENIZER);
75  if (is_null($data)) {
76  return null;
77  }
78 
79  $this->suggestTokenizer = SuggestTokenizerModel::of($data);
80  }
81 
83  }
84 
85 
89  public function setText(?string $text): void
90  {
91  $this->text = $text;
92  }
93 
98  {
99  $this->suggestTokenizer = $suggestTokenizer;
100  }
101 }
setSuggestTokenizer(?SuggestTokenizer $suggestTokenizer)
__construct(?string $text=null, ?SuggestTokenizer $suggestTokenizer=null)