commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
CustomFieldDateTypeModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
21 {
22  public const DISCRIMINATOR_VALUE = 'Date';
27  protected $name;
28 
29 
33  public function __construct(
34  ?string $name = null
35  ) {
36  $this->name = $name ?? self::DISCRIMINATOR_VALUE;
37  }
38 
43  public function getName()
44  {
45  if (is_null($this->name)) {
47  $data = $this->raw(self::FIELD_NAME);
48  if (is_null($data)) {
49  return null;
50  }
51  $this->name = (string) $data;
52  }
53 
54  return $this->name;
55  }
56 }