commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
McpServerSetNameActionModel.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
24 public const DISCRIMINATOR_VALUE = 'setName';
29 protected $action;
30
35 protected $name;
36
37
41 public function __construct(
42 ?LocalizedString $name = null,
43 ?string $action = null
44 ) {
45 $this->name = $name;
46 $this->action = $action ?? self::DISCRIMINATOR_VALUE;
47 }
48
55 public function getAction()
56 {
57 if (is_null($this->action)) {
59 $data = $this->raw(self::FIELD_ACTION);
60 if (is_null($data)) {
61 return null;
62 }
63 $this->action = (string) $data;
64 }
65
66 return $this->action;
67 }
68
75 public function getName()
76 {
77 if (is_null($this->name)) {
79 $data = $this->raw(self::FIELD_NAME);
80 if (is_null($data)) {
81 return null;
82 }
83
84 $this->name = LocalizedStringModel::of($data);
85 }
86
87 return $this->name;
88 }
89
90
94 public function setName(?LocalizedString $name): void
95 {
96 $this->name = $name;
97 }
98}
__construct(?LocalizedString $name=null, ?string $action=null)