commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CartDiscountValueFixedModel.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(
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
80 public function getMoney()
81 {
82 if (is_null($this->money)) {
84 $data = $this->raw(self::FIELD_MONEY);
85 if (is_null($data)) {
86 return null;
87 }
88 $this->money = TypedMoneyCollection::fromArray($data);
89 }
90
91 return $this->money;
92 }
93
101 public function getApplicationMode()
102 {
103 if (is_null($this->applicationMode)) {
105 $data = $this->raw(self::FIELD_APPLICATION_MODE);
106 if (is_null($data)) {
107 return null;
108 }
109 $this->applicationMode = (string) $data;
110 }
111
113 }
114
115
119 public function setMoney(?TypedMoneyCollection $money): void
120 {
121 $this->money = $money;
122 }
123
127 public function setApplicationMode(?string $applicationMode): void
128 {
129 $this->applicationMode = $applicationMode;
130 }
131}
__construct(?TypedMoneyCollection $money=null, ?string $applicationMode=null, ?string $type=null)