commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
AttributeSetTypeModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
21 {
22  public const DISCRIMINATOR_VALUE = 'set';
27  protected $name;
28 
33  protected $elementType;
34 
35 
39  public function __construct(
41  ?string $name = null
42  ) {
43  $this->elementType = $elementType;
44  $this->name = $name ?? self::DISCRIMINATOR_VALUE;
45  }
46 
51  public function getName()
52  {
53  if (is_null($this->name)) {
55  $data = $this->raw(self::FIELD_NAME);
56  if (is_null($data)) {
57  return null;
58  }
59  $this->name = (string) $data;
60  }
61 
62  return $this->name;
63  }
64 
69  public function getElementType()
70  {
71  if (is_null($this->elementType)) {
73  $data = $this->raw(self::FIELD_ELEMENT_TYPE);
74  if (is_null($data)) {
75  return null;
76  }
78  $this->elementType = $className::of($data);
79  }
80 
81  return $this->elementType;
82  }
83 
84 
88  public function setElementType(?AttributeType $elementType): void
89  {
90  $this->elementType = $elementType;
91  }
92 }
__construct(?AttributeType $elementType=null, ?string $name=null)