commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
OrderEditAppliedBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use DateTimeImmutable;
17 use stdClass;
18 
22 final class OrderEditAppliedBuilder implements Builder
23 {
28  private $appliedAt;
29 
34  private $excerptBeforeEdit;
35 
40  private $excerptAfterEdit;
41 
48  public function getAppliedAt()
49  {
50  return $this->appliedAt;
51  }
52 
59  public function getExcerptBeforeEdit()
60  {
61  return $this->excerptBeforeEdit instanceof OrderExcerptBuilder ? $this->excerptBeforeEdit->build() : $this->excerptBeforeEdit;
62  }
63 
70  public function getExcerptAfterEdit()
71  {
72  return $this->excerptAfterEdit instanceof OrderExcerptBuilder ? $this->excerptAfterEdit->build() : $this->excerptAfterEdit;
73  }
74 
79  public function withAppliedAt(?DateTimeImmutable $appliedAt)
80  {
81  $this->appliedAt = $appliedAt;
82 
83  return $this;
84  }
85 
90  public function withExcerptBeforeEdit(?OrderExcerpt $excerptBeforeEdit)
91  {
92  $this->excerptBeforeEdit = $excerptBeforeEdit;
93 
94  return $this;
95  }
96 
101  public function withExcerptAfterEdit(?OrderExcerpt $excerptAfterEdit)
102  {
103  $this->excerptAfterEdit = $excerptAfterEdit;
104 
105  return $this;
106  }
107 
112  public function withExcerptBeforeEditBuilder(?OrderExcerptBuilder $excerptBeforeEdit)
113  {
114  $this->excerptBeforeEdit = $excerptBeforeEdit;
115 
116  return $this;
117  }
118 
123  public function withExcerptAfterEditBuilder(?OrderExcerptBuilder $excerptAfterEdit)
124  {
125  $this->excerptAfterEdit = $excerptAfterEdit;
126 
127  return $this;
128  }
129 
130  public function build(): OrderEditApplied
131  {
132  return new OrderEditAppliedModel(
133  $this->appliedAt,
134  $this->excerptBeforeEdit instanceof OrderExcerptBuilder ? $this->excerptBeforeEdit->build() : $this->excerptBeforeEdit,
135  $this->excerptAfterEdit instanceof OrderExcerptBuilder ? $this->excerptAfterEdit->build() : $this->excerptAfterEdit
136  );
137  }
138 
139  public static function of(): OrderEditAppliedBuilder
140  {
141  return new self();
142  }
143 }
withExcerptBeforeEditBuilder(?OrderExcerptBuilder $excerptBeforeEdit)
withExcerptAfterEditBuilder(?OrderExcerptBuilder $excerptAfterEdit)