commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ExtensionInputModel.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
28 protected $action;
29
34 protected $resource;
35
36
40 public function __construct(
41 ?string $action = null,
42 ?Reference $resource = null
43 ) {
44 $this->action = $action;
45 $this->resource = $resource;
46 }
47
54 public function getAction()
55 {
56 if (is_null($this->action)) {
58 $data = $this->raw(self::FIELD_ACTION);
59 if (is_null($data)) {
60 return null;
61 }
62 $this->action = (string) $data;
63 }
64
65 return $this->action;
66 }
67
74 public function getResource()
75 {
76 if (is_null($this->resource)) {
78 $data = $this->raw(self::FIELD_RESOURCE);
79 if (is_null($data)) {
80 return null;
81 }
82 $className = ReferenceModel::resolveDiscriminatorClass($data);
83 $this->resource = $className::of($data);
84 }
85
86 return $this->resource;
87 }
88
89
93 public function setAction(?string $action): void
94 {
95 $this->action = $action;
96 }
97
101 public function setResource(?Reference $resource): void
102 {
103 $this->resource = $resource;
104 }
105}
__construct(?string $action=null, ?Reference $resource=null)