commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ApprovalFlowCompletedMessagePayloadModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
17 use stdClass;
18 
23 {
24  public const DISCRIMINATOR_VALUE = 'ApprovalFlowCompleted';
29  protected $type;
30 
35  protected $status;
36 
41  protected $order;
42 
43 
47  public function __construct(
48  ?string $status = null,
49  ?OrderReference $order = null,
50  ?string $type = null
51  ) {
52  $this->status = $status;
53  $this->order = $order;
54  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
55  }
56 
61  public function getType()
62  {
63  if (is_null($this->type)) {
65  $data = $this->raw(self::FIELD_TYPE);
66  if (is_null($data)) {
67  return null;
68  }
69  $this->type = (string) $data;
70  }
71 
72  return $this->type;
73  }
74 
81  public function getStatus()
82  {
83  if (is_null($this->status)) {
85  $data = $this->raw(self::FIELD_STATUS);
86  if (is_null($data)) {
87  return null;
88  }
89  $this->status = (string) $data;
90  }
91 
92  return $this->status;
93  }
94 
101  public function getOrder()
102  {
103  if (is_null($this->order)) {
105  $data = $this->raw(self::FIELD_ORDER);
106  if (is_null($data)) {
107  return null;
108  }
109 
110  $this->order = OrderReferenceModel::of($data);
111  }
112 
113  return $this->order;
114  }
115 
116 
120  public function setStatus(?string $status): void
121  {
122  $this->status = $status;
123  }
124 
128  public function setOrder(?OrderReference $order): void
129  {
130  $this->order = $order;
131  }
132 }
__construct(?string $status=null, ?OrderReference $order=null, ?string $type=null)