commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ReferenceExistsErrorBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
21 final class ReferenceExistsErrorBuilder implements Builder
22 {
27  private $message;
28 
33  private $referencedBy;
34 
41  public function getMessage()
42  {
43  return $this->message;
44  }
45 
52  public function getReferencedBy()
53  {
54  return $this->referencedBy;
55  }
56 
61  public function withMessage(?string $message)
62  {
63  $this->message = $message;
64 
65  return $this;
66  }
67 
72  public function withReferencedBy(?string $referencedBy)
73  {
74  $this->referencedBy = $referencedBy;
75 
76  return $this;
77  }
78 
79 
80  public function build(): ReferenceExistsError
81  {
82  return new ReferenceExistsErrorModel(
83  $this->message,
84  $this->referencedBy
85  );
86  }
87 
88  public static function of(): ReferenceExistsErrorBuilder
89  {
90  return new self();
91  }
92 }