commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
DateSetAttributeModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
22 public const DISCRIMINATOR_VALUE = 'date-set';
27 protected $name;
28
33 protected $type;
34
39 protected $value;
40
41
45 public function __construct(
46 ?string $name = null,
48 ?string $type = null
49 ) {
50 $this->name = $name;
51 $this->value = $value;
52 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
53 }
54
63 public function getName()
64 {
65 if (is_null($this->name)) {
67 $data = $this->raw(self::FIELD_NAME);
68 if (is_null($data)) {
69 return null;
70 }
71 $this->name = (string) $data;
72 }
73
74 return $this->name;
75 }
76
85 public function getType()
86 {
87 if (is_null($this->type)) {
89 $data = $this->raw(self::FIELD_TYPE);
90 if (is_null($data)) {
91 return null;
92 }
93 $this->type = (string) $data;
94 }
95
96 return $this->type;
97 }
98
105 public function getValue()
106 {
107 if (is_null($this->value)) {
109 $data = $this->raw(self::FIELD_VALUE);
110 if (is_null($data)) {
111 return null;
112 }
113 $this->value = new DateTimeImmutableCollection($data);
114 }
115
116 return $this->value;
117 }
118
119
123 public function setName(?string $name): void
124 {
125 $this->name = $name;
126 }
127
132 {
133 $this->value = $value;
134 }
135}
__construct(?string $name=null, ?DateTimeImmutableCollection $value=null, ?string $type=null)