commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
ProductTypeImportRequestModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
22 {
23  public const DISCRIMINATOR_VALUE = 'product-type';
28  protected $type;
29 
34  protected $resources;
35 
36 
40  public function __construct(
42  ?string $type = null
43  ) {
44  $this->resources = $resources;
45  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
46  }
47 
54  public function getType()
55  {
56  if (is_null($this->type)) {
58  $data = $this->raw(self::FIELD_TYPE);
59  if (is_null($data)) {
60  return null;
61  }
62  $this->type = (string) $data;
63  }
64 
65  return $this->type;
66  }
67 
74  public function getResources()
75  {
76  if (is_null($this->resources)) {
78  $data = $this->raw(self::FIELD_RESOURCES);
79  if (is_null($data)) {
80  return null;
81  }
82  $this->resources = ProductTypeImportCollection::fromArray($data);
83  }
84 
85  return $this->resources;
86  }
87 
88 
93  {
94  $this->resources = $resources;
95  }
96 }
__construct(?ProductTypeImportCollection $resources=null, ?string $type=null)