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
101 public function getRetentionPolicy()
102 {
103 if (is_null($this->retentionPolicy)) {
105 $data = $this->raw(self::FIELD_RETENTION_POLICY);
106 if (is_null($data)) {
107 return null;
108 }
110 $this->retentionPolicy = $className::of($data);
111 }
112
114 }
115
116
120 public function setKey(?string $key): void
121 {
122 $this->key = $key;
123 }
124
128 public function setResourceType(?string $resourceType): void
129 {
130 $this->resourceType = $resourceType;
131 }
132
137 {
138 $this->retentionPolicy = $retentionPolicy;
139 }
140}
__construct(?string $key=null, ?string $resourceType=null, ?RetentionPolicy $retentionPolicy=null)