commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
TimeAttributeBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use DateTimeImmutable;
17use stdClass;
18
22final class TimeAttributeBuilder implements Builder
23{
28 private $name;
29
34 private $value;
35
44 public function getName()
45 {
46 return $this->name;
47 }
48
57 public function getValue()
58 {
59 return $this->value;
60 }
61
66 public function withName(?string $name)
67 {
68 $this->name = $name;
69
70 return $this;
71 }
72
77 public function withValue(?DateTimeImmutable $value)
78 {
79 $this->value = $value;
80
81 return $this;
82 }
83
84
85 public function build(): TimeAttribute
86 {
87 return new TimeAttributeModel(
88 $this->name,
89 $this->value
90 );
91 }
92
93 public static function of(): TimeAttributeBuilder
94 {
95 return new self();
96 }
97}