commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
BaseResourceBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
482 use DateTimeImmutable;
483 use stdClass;
484 
488 final class BaseResourceBuilder implements Builder
489 {
494  private $id;
495 
500  private $version;
501 
506  private $createdAt;
507 
512  private $lastModifiedAt;
513 
518  public function getId()
519  {
520  return $this->id;
521  }
522 
527  public function getVersion()
528  {
529  return $this->version;
530  }
531 
536  public function getCreatedAt()
537  {
538  return $this->createdAt;
539  }
540 
545  public function getLastModifiedAt()
546  {
547  return $this->lastModifiedAt;
548  }
549 
554  public function withId(?string $id)
555  {
556  $this->id = $id;
557 
558  return $this;
559  }
560 
565  public function withVersion(?int $version)
566  {
567  $this->version = $version;
568 
569  return $this;
570  }
571 
576  public function withCreatedAt(?DateTimeImmutable $createdAt)
577  {
578  $this->createdAt = $createdAt;
579 
580  return $this;
581  }
582 
587  public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
588  {
589  $this->lastModifiedAt = $lastModifiedAt;
590 
591  return $this;
592  }
593 
594 
595  public function build(): BaseResource
596  {
597  return new BaseResourceModel(
598  $this->id,
599  $this->version,
600  $this->createdAt,
601  $this->lastModifiedAt
602  );
603  }
604 
605  public static function of(): BaseResourceBuilder
606  {
607  return new self();
608  }
609 }
withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)