commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
ImportContainerBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use DateTimeImmutable;
17 use stdClass;
18 
22 final class ImportContainerBuilder implements Builder
23 {
28  private $key;
29 
34  private $resourceType;
35 
40  private $version;
41 
46  private $createdAt;
47 
52  private $lastModifiedAt;
53 
61  public function getKey()
62  {
63  return $this->key;
64  }
65 
73  public function getResourceType()
74  {
75  return $this->resourceType;
76  }
77 
84  public function getVersion()
85  {
86  return $this->version;
87  }
88 
95  public function getCreatedAt()
96  {
97  return $this->createdAt;
98  }
99 
106  public function getLastModifiedAt()
107  {
108  return $this->lastModifiedAt;
109  }
110 
115  public function withKey(?string $key)
116  {
117  $this->key = $key;
118 
119  return $this;
120  }
121 
126  public function withResourceType(?string $resourceType)
127  {
128  $this->resourceType = $resourceType;
129 
130  return $this;
131  }
132 
137  public function withVersion(?int $version)
138  {
139  $this->version = $version;
140 
141  return $this;
142  }
143 
148  public function withCreatedAt(?DateTimeImmutable $createdAt)
149  {
150  $this->createdAt = $createdAt;
151 
152  return $this;
153  }
154 
159  public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
160  {
161  $this->lastModifiedAt = $lastModifiedAt;
162 
163  return $this;
164  }
165 
166 
167  public function build(): ImportContainer
168  {
169  return new ImportContainerModel(
170  $this->key,
171  $this->resourceType,
172  $this->version,
173  $this->createdAt,
174  $this->lastModifiedAt
175  );
176  }
177 
178  public static function of(): ImportContainerBuilder
179  {
180  return new self();
181  }
182 }