commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CustomerSetCustomFieldActionModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
22 public const DISCRIMINATOR_VALUE = 'setCustomField';
27 protected $action;
28
33 protected $name;
34
39 protected $value;
40
41
45 public function __construct(
46 ?string $name = null,
47 $value = null,
48 ?string $action = null
49 ) {
50 $this->name = $name;
51 $this->value = $value;
52 $this->action = $action ?? self::DISCRIMINATOR_VALUE;
53 }
54
59 public function getAction()
60 {
61 if (is_null($this->action)) {
63 $data = $this->raw(self::FIELD_ACTION);
64 if (is_null($data)) {
65 return null;
66 }
67 $this->action = (string) $data;
68 }
69
70 return $this->action;
71 }
72
79 public function getName()
80 {
81 if (is_null($this->name)) {
83 $data = $this->raw(self::FIELD_NAME);
84 if (is_null($data)) {
85 return null;
86 }
87 $this->name = (string) $data;
88 }
89
90 return $this->name;
91 }
92
101 public function getValue()
102 {
103 if (is_null($this->value)) {
105 $data = $this->raw(self::FIELD_VALUE);
106 if (is_null($data)) {
107 return null;
108 }
109 $this->value = $data;
110 }
111
112 return $this->value;
113 }
114
115
119 public function setName(?string $name): void
120 {
121 $this->name = $name;
122 }
123
127 public function setValue($value): void
128 {
129 $this->value = $value;
130 }
131}