commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
QuoteCustomerChangedMessagePayloadModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
17 use stdClass;
18 
23 {
24  public const DISCRIMINATOR_VALUE = 'QuoteCustomerChanged';
29  protected $type;
30 
35  protected $customer;
36 
41  protected $previousCustomer;
42 
43 
47  public function __construct(
50  ?string $type = null
51  ) {
52  $this->customer = $customer;
53  $this->previousCustomer = $previousCustomer;
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 getCustomer()
82  {
83  if (is_null($this->customer)) {
85  $data = $this->raw(self::FIELD_CUSTOMER);
86  if (is_null($data)) {
87  return null;
88  }
89 
90  $this->customer = CustomerReferenceModel::of($data);
91  }
92 
93  return $this->customer;
94  }
95 
102  public function getPreviousCustomer()
103  {
104  if (is_null($this->previousCustomer)) {
106  $data = $this->raw(self::FIELD_PREVIOUS_CUSTOMER);
107  if (is_null($data)) {
108  return null;
109  }
110 
111  $this->previousCustomer = CustomerReferenceModel::of($data);
112  }
113 
115  }
116 
117 
121  public function setCustomer(?CustomerReference $customer): void
122  {
123  $this->customer = $customer;
124  }
125 
130  {
131  $this->previousCustomer = $previousCustomer;
132  }
133 }
__construct(?CustomerReference $customer=null, ?CustomerReference $previousCustomer=null, ?string $type=null)