commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
ProductTypeImportModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
17 use stdClass;
18 
23 {
28  protected $key;
29 
34  protected $name;
35 
40  protected $description;
41 
46  protected $attributes;
47 
48 
52  public function __construct(
53  ?string $key = null,
54  ?string $name = null,
55  ?string $description = null,
57  ) {
58  $this->key = $key;
59  $this->name = $name;
60  $this->description = $description;
61  $this->attributes = $attributes;
62  }
63 
70  public function getKey()
71  {
72  if (is_null($this->key)) {
74  $data = $this->raw(self::FIELD_KEY);
75  if (is_null($data)) {
76  return null;
77  }
78  $this->key = (string) $data;
79  }
80 
81  return $this->key;
82  }
83 
90  public function getName()
91  {
92  if (is_null($this->name)) {
94  $data = $this->raw(self::FIELD_NAME);
95  if (is_null($data)) {
96  return null;
97  }
98  $this->name = (string) $data;
99  }
100 
101  return $this->name;
102  }
103 
110  public function getDescription()
111  {
112  if (is_null($this->description)) {
114  $data = $this->raw(self::FIELD_DESCRIPTION);
115  if (is_null($data)) {
116  return null;
117  }
118  $this->description = (string) $data;
119  }
120 
121  return $this->description;
122  }
123 
130  public function getAttributes()
131  {
132  if (is_null($this->attributes)) {
134  $data = $this->raw(self::FIELD_ATTRIBUTES);
135  if (is_null($data)) {
136  return null;
137  }
138  $this->attributes = AttributeDefinitionCollection::fromArray($data);
139  }
140 
141  return $this->attributes;
142  }
143 
144 
148  public function setKey(?string $key): void
149  {
150  $this->key = $key;
151  }
152 
156  public function setName(?string $name): void
157  {
158  $this->name = $name;
159  }
160 
164  public function setDescription(?string $description): void
165  {
166  $this->description = $description;
167  }
168 
173  {
174  $this->attributes = $attributes;
175  }
176 }
__construct(?string $key=null, ?string $name=null, ?string $description=null, ?AttributeDefinitionCollection $attributes=null)