commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ApprovalFlowRejectedMessagePayloadModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
19 use stdClass;
20 
25 {
26  public const DISCRIMINATOR_VALUE = 'ApprovalFlowRejected';
31  protected $type;
32 
37  protected $associate;
38 
43  protected $rejectionReason;
44 
49  protected $order;
50 
51 
55  public function __construct(
57  ?string $rejectionReason = null,
58  ?OrderReference $order = null,
59  ?string $type = null
60  ) {
61  $this->associate = $associate;
62  $this->rejectionReason = $rejectionReason;
63  $this->order = $order;
64  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
65  }
66 
71  public function getType()
72  {
73  if (is_null($this->type)) {
75  $data = $this->raw(self::FIELD_TYPE);
76  if (is_null($data)) {
77  return null;
78  }
79  $this->type = (string) $data;
80  }
81 
82  return $this->type;
83  }
84 
91  public function getAssociate()
92  {
93  if (is_null($this->associate)) {
95  $data = $this->raw(self::FIELD_ASSOCIATE);
96  if (is_null($data)) {
97  return null;
98  }
99 
100  $this->associate = CustomerReferenceModel::of($data);
101  }
102 
103  return $this->associate;
104  }
105 
112  public function getRejectionReason()
113  {
114  if (is_null($this->rejectionReason)) {
116  $data = $this->raw(self::FIELD_REJECTION_REASON);
117  if (is_null($data)) {
118  return null;
119  }
120  $this->rejectionReason = (string) $data;
121  }
122 
123  return $this->rejectionReason;
124  }
125 
132  public function getOrder()
133  {
134  if (is_null($this->order)) {
136  $data = $this->raw(self::FIELD_ORDER);
137  if (is_null($data)) {
138  return null;
139  }
140 
141  $this->order = OrderReferenceModel::of($data);
142  }
143 
144  return $this->order;
145  }
146 
147 
151  public function setAssociate(?CustomerReference $associate): void
152  {
153  $this->associate = $associate;
154  }
155 
159  public function setRejectionReason(?string $rejectionReason): void
160  {
161  $this->rejectionReason = $rejectionReason;
162  }
163 
167  public function setOrder(?OrderReference $order): void
168  {
169  $this->order = $order;
170  }
171 }
__construct(?CustomerReference $associate=null, ?string $rejectionReason=null, ?OrderReference $order=null, ?string $type=null)