commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
MoneySetAttributeModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
22 {
23  public const DISCRIMINATOR_VALUE = 'money-set';
28  protected $name;
29 
34  protected $type;
35 
40  protected $value;
41 
42 
46  public function __construct(
47  ?string $name = null,
49  ?string $type = null
50  ) {
51  $this->name = $name;
52  $this->value = $value;
53  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
54  }
55 
64  public function getName()
65  {
66  if (is_null($this->name)) {
68  $data = $this->raw(self::FIELD_NAME);
69  if (is_null($data)) {
70  return null;
71  }
72  $this->name = (string) $data;
73  }
74 
75  return $this->name;
76  }
77 
82  public function getType()
83  {
84  if (is_null($this->type)) {
86  $data = $this->raw(self::FIELD_TYPE);
87  if (is_null($data)) {
88  return null;
89  }
90  $this->type = (string) $data;
91  }
92 
93  return $this->type;
94  }
95 
100  public function getValue()
101  {
102  if (is_null($this->value)) {
104  $data = $this->raw(self::FIELD_VALUE);
105  if (is_null($data)) {
106  return null;
107  }
108  $this->value = TypedMoneyCollection::fromArray($data);
109  }
110 
111  return $this->value;
112  }
113 
114 
118  public function setName(?string $name): void
119  {
120  $this->name = $name;
121  }
122 
126  public function setValue(?TypedMoneyCollection $value): void
127  {
128  $this->value = $value;
129  }
130 }
__construct(?string $name=null, ?TypedMoneyCollection $value=null, ?string $type=null)