commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Product
SuggestionModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Product
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
15
use stdClass;
16
20
final
class
SuggestionModel
extends
JsonObjectModel
implements
Suggestion
21
{
26
protected
$text
;
27
28
32
public
function
__construct
(
33
?
string
$text
=
null
34
) {
35
$this->text =
$text
;
36
}
37
44
public
function
getText
()
45
{
46
if
(is_null($this->text)) {
48
$data = $this->
raw
(self::FIELD_TEXT);
49
if
(is_null($data)) {
50
return
null
;
51
}
52
$this->text = (string) $data;
53
}
54
55
return
$this->text
;
56
}
57
58
62
public
function
setText
(?
string
$text
): void
63
{
64
$this->text =
$text
;
65
}
66
}
Commercetools\Api\Models\Product\SuggestionModel
Definition:
SuggestionModel.php:21
Commercetools\Api\Models\Product\SuggestionModel\$text
$text
Definition:
SuggestionModel.php:26
Commercetools\Api\Models\Product\SuggestionModel\__construct
__construct(?string $text=null)
Definition:
SuggestionModel.php:32
Commercetools\Api\Models\Product\SuggestionModel\setText
setText(?string $text)
Definition:
SuggestionModel.php:62
Commercetools\Api\Models\Product\SuggestionModel\getText
getText()
Definition:
SuggestionModel.php:44
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\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\Api\Models\Product\Suggestion
Definition:
Suggestion.php:15
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Product
Definition:
AttributeAccessor.php:4
Generated by
1.9.1