commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
PriceFunctionModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
20final class PriceFunctionModel extends JsonObjectModel implements PriceFunction
21{
26 protected $currencyCode;
27
32 protected $function;
33
34
38 public function __construct(
39 ?string $currencyCode = null,
40 ?string $function = null
41 ) {
42 $this->currencyCode = $currencyCode;
43 $this->function = $function;
44 }
45
52 public function getCurrencyCode()
53 {
54 if (is_null($this->currencyCode)) {
56 $data = $this->raw(self::FIELD_CURRENCY_CODE);
57 if (is_null($data)) {
58 return null;
59 }
60 $this->currencyCode = (string) $data;
61 }
62
64 }
65
73 public function getFunction()
74 {
75 if (is_null($this->function)) {
77 $data = $this->raw(self::FIELD_FUNCTION);
78 if (is_null($data)) {
79 return null;
80 }
81 $this->function = (string) $data;
82 }
83
84 return $this->function;
85 }
86
87
91 public function setCurrencyCode(?string $currencyCode): void
92 {
93 $this->currencyCode = $currencyCode;
94 }
95
99 public function setFunction(?string $function): void
100 {
101 $this->function = $function;
102 }
103}
__construct(?string $currencyCode=null, ?string $function=null)