commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
DateAttributeBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use DateTimeImmutable;
17 use stdClass;
18 
22 final class DateAttributeBuilder implements Builder
23 {
28  private $name;
29 
34  private $value;
35 
44  public function getName()
45  {
46  return $this->name;
47  }
48 
53  public function getValue()
54  {
55  return $this->value;
56  }
57 
62  public function withName(?string $name)
63  {
64  $this->name = $name;
65 
66  return $this;
67  }
68 
73  public function withValue(?DateTimeImmutable $value)
74  {
75  $this->value = $value;
76 
77  return $this;
78  }
79 
80 
81  public function build(): DateAttribute
82  {
83  return new DateAttributeModel(
84  $this->name,
85  $this->value
86  );
87  }
88 
89  public static function of(): DateAttributeBuilder
90  {
91  return new self();
92  }
93 }