commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CartDiscountValueFixedDraftModel.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
17
22{
23 public const DISCRIMINATOR_VALUE = 'fixed';
28 protected $type;
29
34 protected $money;
35
41
42
46 public function __construct(
47 ?MoneyCollection $money = null,
48 ?string $applicationMode = null,
49 ?string $type = null
50 ) {
51 $this->money = $money;
52 $this->applicationMode = $applicationMode;
53 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
54 }
55
60 public function getType()
61 {
62 if (is_null($this->type)) {
64 $data = $this->raw(self::FIELD_TYPE);
65 if (is_null($data)) {
66 return null;
67 }
68 $this->type = (string) $data;
69 }
70
71 return $this->type;
72 }
73
82 public function getMoney()
83 {
84 if (is_null($this->money)) {
86 $data = $this->raw(self::FIELD_MONEY);
87 if (is_null($data)) {
88 return null;
89 }
90 $this->money = MoneyCollection::fromArray($data);
91 }
92
93 return $this->money;
94 }
95
103 public function getApplicationMode()
104 {
105 if (is_null($this->applicationMode)) {
107 $data = $this->raw(self::FIELD_APPLICATION_MODE);
108 if (is_null($data)) {
109 return null;
110 }
111 $this->applicationMode = (string) $data;
112 }
113
115 }
116
117
121 public function setMoney(?MoneyCollection $money): void
122 {
123 $this->money = $money;
124 }
125
129 public function setApplicationMode(?string $applicationMode): void
130 {
131 $this->applicationMode = $applicationMode;
132 }
133}
__construct(?MoneyCollection $money=null, ?string $applicationMode=null, ?string $type=null)