commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
ImportResourceModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
37 use stdClass;
38 
42 final class ImportResourceModel extends JsonObjectModel implements ImportResource
43 {
48  protected $key;
49 
50 
54  public function __construct(
55  ?string $key = null
56  ) {
57  $this->key = $key;
58  }
59 
66  public function getKey()
67  {
68  if (is_null($this->key)) {
70  $data = $this->raw(self::FIELD_KEY);
71  if (is_null($data)) {
72  return null;
73  }
74  $this->key = (string) $data;
75  }
76 
77  return $this->key;
78  }
79 
80 
84  public function setKey(?string $key): void
85  {
86  $this->key = $key;
87  }
88 }