commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
CartDiscountValueAbsoluteDraftModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
22 {
23  public const DISCRIMINATOR_VALUE = 'absolute';
28  protected $type;
29 
34  protected $money;
35 
40  protected $applicationMode;
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 
114  return $this->applicationMode;
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)