| Total Complexity | 8 |
| Total Lines | 94 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | final class Product extends BaseResource implements Emptiable |
||
| 9 | { |
||
| 10 | use EmptiableTrait; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | private $name; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var int |
||
| 19 | */ |
||
| 20 | private $quantity; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var float |
||
| 24 | */ |
||
| 25 | private $unitPrice; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var string |
||
| 29 | */ |
||
| 30 | private $sku; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @return string |
||
| 34 | */ |
||
| 35 | public function getName() |
||
| 36 | { |
||
| 37 | return $this->name; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param string $name |
||
| 42 | */ |
||
| 43 | public function setName($name) |
||
| 44 | { |
||
| 45 | $this->name = substr($name, 0, 100); |
||
| 46 | |||
| 47 | return $this; |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @return int |
||
| 52 | */ |
||
| 53 | public function getQuantity() |
||
| 54 | { |
||
| 55 | return $this->quantity; |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @param int $quantity |
||
| 60 | */ |
||
| 61 | public function setQuantity($quantity) |
||
| 62 | { |
||
| 63 | $this->quantity = (int) $quantity; |
||
| 64 | |||
| 65 | return $this; |
||
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @return float |
||
| 70 | */ |
||
| 71 | public function getUnitPrice() |
||
| 74 | } |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @param mixed $unitPrice |
||
| 78 | */ |
||
| 79 | public function setUnitPrice($unitPrice) |
||
| 80 | { |
||
| 81 | $this->unitPrice = $this->getNumberUtil()->convertToDouble($unitPrice); |
||
| 82 | |||
| 83 | return $this; |
||
| 84 | } |
||
| 85 | |||
| 86 | /** |
||
| 87 | * @return string |
||
| 88 | */ |
||
| 89 | public function getSku() |
||
| 92 | } |
||
| 93 | |||
| 94 | /** |
||
| 95 | * @param string $sku |
||
| 96 | */ |
||
| 97 | public function setSku($sku) |
||
| 102 | } |
||
| 103 | } |
||
| 104 |