commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
All Classes Namespaces Functions Variables Pages
DeliveryPayloadModel.php
1<?php
2
3declare(strict_types=1);
10
19use stdClass;
20
25{
31
36 protected $projectKey;
37
42 protected $resource;
43
49
50
54 public function __construct(
55 ?string $projectKey = null,
56 ?Reference $resource = null,
58 ?string $notificationType = null
59 ) {
60 $this->projectKey = $projectKey;
61 $this->resource = $resource;
62 $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers;
63 $this->notificationType = $notificationType;
64 }
65
72 public function getNotificationType()
73 {
74 if (is_null($this->notificationType)) {
76 $data = $this->raw(self::FIELD_NOTIFICATION_TYPE);
77 if (is_null($data)) {
78 return null;
79 }
80 $this->notificationType = (string) $data;
81 }
82
84 }
85
93 public function getProjectKey()
94 {
95 if (is_null($this->projectKey)) {
97 $data = $this->raw(self::FIELD_PROJECT_KEY);
98 if (is_null($data)) {
99 return null;
100 }
101 $this->projectKey = (string) $data;
102 }
103
104 return $this->projectKey;
105 }
106
113 public function getResource()
114 {
115 if (is_null($this->resource)) {
117 $data = $this->raw(self::FIELD_RESOURCE);
118 if (is_null($data)) {
119 return null;
120 }
121 $className = ReferenceModel::resolveDiscriminatorClass($data);
122 $this->resource = $className::of($data);
123 }
124
125 return $this->resource;
126 }
127
135 {
136 if (is_null($this->resourceUserProvidedIdentifiers)) {
138 $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS);
139 if (is_null($data)) {
140 return null;
141 }
142
143 $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data);
144 }
145
147 }
148
149
153 public function setProjectKey(?string $projectKey): void
154 {
155 $this->projectKey = $projectKey;
156 }
157
161 public function setResource(?Reference $resource): void
162 {
163 $this->resource = $resource;
164 }
165
170 {
171 $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers;
172 }
173}
setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers)
__construct(?string $projectKey=null, ?Reference $resource=null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers=null, ?string $notificationType=null)