commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
AddProductChangeBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
21 
25 final class AddProductChangeBuilder implements Builder
26 {
31  private $change;
32 
37  private $nextValue;
38 
43  private $variantSelection;
44 
49  public function getChange()
50  {
51  return $this->change;
52  }
53 
60  public function getNextValue()
61  {
62  return $this->nextValue instanceof ReferenceBuilder ? $this->nextValue->build() : $this->nextValue;
63  }
64 
71  public function getVariantSelection()
72  {
73  return $this->variantSelection instanceof ProductVariantSelectionBuilder ? $this->variantSelection->build() : $this->variantSelection;
74  }
75 
80  public function withChange(?string $change)
81  {
82  $this->change = $change;
83 
84  return $this;
85  }
86 
91  public function withNextValue(?Reference $nextValue)
92  {
93  $this->nextValue = $nextValue;
94 
95  return $this;
96  }
97 
102  public function withVariantSelection(?ProductVariantSelection $variantSelection)
103  {
104  $this->variantSelection = $variantSelection;
105 
106  return $this;
107  }
108 
113  public function withNextValueBuilder(?ReferenceBuilder $nextValue)
114  {
115  $this->nextValue = $nextValue;
116 
117  return $this;
118  }
119 
125  {
126  $this->variantSelection = $variantSelection;
127 
128  return $this;
129  }
130 
131  public function build(): AddProductChange
132  {
133  return new AddProductChangeModel(
134  $this->change,
135  $this->nextValue instanceof ReferenceBuilder ? $this->nextValue->build() : $this->nextValue,
136  $this->variantSelection instanceof ProductVariantSelectionBuilder ? $this->variantSelection->build() : $this->variantSelection
137  );
138  }
139 
140  public static function of(): AddProductChangeBuilder
141  {
142  return new self();
143  }
144 }
withVariantSelectionBuilder(?ProductVariantSelectionBuilder $variantSelection)
withVariantSelection(?ProductVariantSelection $variantSelection)