commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
DateTimeSetAttributeModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
22 public const DISCRIMINATOR_VALUE = 'datetime-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
107 public function getValue()
108 {
109 if (is_null($this->value)) {
111 $data = $this->raw(self::FIELD_VALUE);
112 if (is_null($data)) {
113 return null;
114 }
115 $this->value = new DateTimeImmutableCollection($data);
116 }
117
118 return $this->value;
119 }
120
121
125 public function setName(?string $name): void
126 {
127 $this->name = $name;
128 }
129
134 {
135 $this->value = $value;
136 }
137}
__construct(?string $name=null, ?DateTimeImmutableCollection $value=null, ?string $type=null)