commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ApprovalFlowApprovedMessagePayloadModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
19 use stdClass;
20 
25 {
26  public const DISCRIMINATOR_VALUE = 'ApprovalFlowApproved';
31  protected $type;
32 
37  protected $associate;
38 
43  protected $order;
44 
45 
49  public function __construct(
51  ?OrderReference $order = null,
52  ?string $type = null
53  ) {
54  $this->associate = $associate;
55  $this->order = $order;
56  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
57  }
58 
63  public function getType()
64  {
65  if (is_null($this->type)) {
67  $data = $this->raw(self::FIELD_TYPE);
68  if (is_null($data)) {
69  return null;
70  }
71  $this->type = (string) $data;
72  }
73 
74  return $this->type;
75  }
76 
83  public function getAssociate()
84  {
85  if (is_null($this->associate)) {
87  $data = $this->raw(self::FIELD_ASSOCIATE);
88  if (is_null($data)) {
89  return null;
90  }
91 
92  $this->associate = CustomerReferenceModel::of($data);
93  }
94 
95  return $this->associate;
96  }
97 
104  public function getOrder()
105  {
106  if (is_null($this->order)) {
108  $data = $this->raw(self::FIELD_ORDER);
109  if (is_null($data)) {
110  return null;
111  }
112 
113  $this->order = OrderReferenceModel::of($data);
114  }
115 
116  return $this->order;
117  }
118 
119 
123  public function setAssociate(?CustomerReference $associate): void
124  {
125  $this->associate = $associate;
126  }
127 
131  public function setOrder(?OrderReference $order): void
132  {
133  $this->order = $order;
134  }
135 }
__construct(?CustomerReference $associate=null, ?OrderReference $order=null, ?string $type=null)