commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
CustomerTokenBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use DateTimeImmutable;
17 use stdClass;
18 
22 final class CustomerTokenBuilder implements Builder
23 {
28  private $id;
29 
34  private $customerId;
35 
40  private $value;
41 
46  private $expiresAt;
47 
52  private $createdAt;
53 
58  private $lastModifiedAt;
59 
66  public function getId()
67  {
68  return $this->id;
69  }
70 
77  public function getCustomerId()
78  {
79  return $this->customerId;
80  }
81 
88  public function getValue()
89  {
90  return $this->value;
91  }
92 
99  public function getExpiresAt()
100  {
101  return $this->expiresAt;
102  }
103 
110  public function getCreatedAt()
111  {
112  return $this->createdAt;
113  }
114 
121  public function getLastModifiedAt()
122  {
123  return $this->lastModifiedAt;
124  }
125 
130  public function withId(?string $id)
131  {
132  $this->id = $id;
133 
134  return $this;
135  }
136 
141  public function withCustomerId(?string $customerId)
142  {
143  $this->customerId = $customerId;
144 
145  return $this;
146  }
147 
152  public function withValue(?string $value)
153  {
154  $this->value = $value;
155 
156  return $this;
157  }
158 
163  public function withExpiresAt(?DateTimeImmutable $expiresAt)
164  {
165  $this->expiresAt = $expiresAt;
166 
167  return $this;
168  }
169 
174  public function withCreatedAt(?DateTimeImmutable $createdAt)
175  {
176  $this->createdAt = $createdAt;
177 
178  return $this;
179  }
180 
185  public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
186  {
187  $this->lastModifiedAt = $lastModifiedAt;
188 
189  return $this;
190  }
191 
192 
193  public function build(): CustomerToken
194  {
195  return new CustomerTokenModel(
196  $this->id,
197  $this->customerId,
198  $this->value,
199  $this->expiresAt,
200  $this->createdAt,
201  $this->lastModifiedAt
202  );
203  }
204 
205  public static function of(): CustomerTokenBuilder
206  {
207  return new self();
208  }
209 }