commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ImportContainerDraftModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
26 protected $key;
27
32 protected $resourceType;
33
39
40
44 public function __construct(
45 ?string $key = null,
46 ?string $resourceType = null,
48 ) {
49 $this->key = $key;
50 $this->resourceType = $resourceType;
51 $this->retentionPolicy = $retentionPolicy;
52 }
53
60 public function getKey()
61 {
62 if (is_null($this->key)) {
64 $data = $this->raw(self::FIELD_KEY);
65 if (is_null($data)) {
66 return null;
67 }
68 $this->key = (string) $data;
69 }
70
71 return $this->key;
72 }
73
81 public function getResourceType()
82 {
83 if (is_null($this->resourceType)) {
85 $data = $this->raw(self::FIELD_RESOURCE_TYPE);
86 if (is_null($data)) {
87 return null;
88 }
89 $this->resourceType = (string) $data;
90 }
91
93 }
94
102 public function getRetentionPolicy()
103 {
104 if (is_null($this->retentionPolicy)) {
106 $data = $this->raw(self::FIELD_RETENTION_POLICY);
107 if (is_null($data)) {
108 return null;
109 }
111 $this->retentionPolicy = $className::of($data);
112 }
113
115 }
116
117
121 public function setKey(?string $key): void
122 {
123 $this->key = $key;
124 }
125
129 public function setResourceType(?string $resourceType): void
130 {
131 $this->resourceType = $resourceType;
132 }
133
138 {
139 $this->retentionPolicy = $retentionPolicy;
140 }
141}
__construct(?string $key=null, ?string $resourceType=null, ?RetentionPolicy $retentionPolicy=null)