commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
ScoreShippingRateInputModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
21 {
22  public const DISCRIMINATOR_VALUE = 'Score';
27  protected $type;
28 
33  protected $score;
34 
35 
39  public function __construct(
40  ?int $score = null,
41  ?string $type = null
42  ) {
43  $this->score = $score;
44  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
45  }
46 
51  public function getType()
52  {
53  if (is_null($this->type)) {
55  $data = $this->raw(self::FIELD_TYPE);
56  if (is_null($data)) {
57  return null;
58  }
59  $this->type = (string) $data;
60  }
61 
62  return $this->type;
63  }
64 
69  public function getScore()
70  {
71  if (is_null($this->score)) {
73  $data = $this->raw(self::FIELD_SCORE);
74  if (is_null($data)) {
75  return null;
76  }
77  $this->score = (int) $data;
78  }
79 
80  return $this->score;
81  }
82 
83 
87  public function setScore(?int $score): void
88  {
89  $this->score = $score;
90  }
91 }