commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
DuplicateAttributeValueErrorBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use stdClass;
19 
24 {
29  private $message;
30 
35  private $attribute;
36 
41  public function getMessage()
42  {
43  return $this->message;
44  }
45 
52  public function getAttribute()
53  {
54  return $this->attribute instanceof AttributeBuilder ? $this->attribute->build() : $this->attribute;
55  }
56 
61  public function withMessage(?string $message)
62  {
63  $this->message = $message;
64 
65  return $this;
66  }
67 
72  public function withAttribute(?Attribute $attribute)
73  {
74  $this->attribute = $attribute;
75 
76  return $this;
77  }
78 
83  public function withAttributeBuilder(?AttributeBuilder $attribute)
84  {
85  $this->attribute = $attribute;
86 
87  return $this;
88  }
89 
91  {
93  $this->message,
94  $this->attribute instanceof AttributeBuilder ? $this->attribute->build() : $this->attribute
95  );
96  }
97 
98  public static function of(): DuplicateAttributeValueErrorBuilder
99  {
100  return new self();
101  }
102 }