| Total Complexity | 11 |
| Total Lines | 78 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class Details extends AbstractModel |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var Product[] |
||
| 16 | */ |
||
| 17 | protected $products; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var int $shipping_cost Shipping cost for the order |
||
| 21 | */ |
||
| 22 | protected $shippingCost; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Details constructor. |
||
| 26 | */ |
||
| 27 | public function __construct() |
||
| 28 | { |
||
| 29 | $this->products = array(); |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @return Product[] |
||
| 34 | */ |
||
| 35 | public function getProducts() |
||
| 36 | { |
||
| 37 | return $this->products; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param Product $product |
||
| 42 | * |
||
| 43 | * @return Details |
||
| 44 | */ |
||
| 45 | public function addProduct(Product $product) |
||
| 46 | { |
||
| 47 | $this->products[] = $product; |
||
| 48 | |||
| 49 | return $this; |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @return int |
||
| 54 | */ |
||
| 55 | public function getShippingCost() |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @param $shippingCost |
||
| 62 | * |
||
| 63 | * @return $this |
||
| 64 | */ |
||
| 65 | public function setShippingCost($shippingCost) |
||
| 70 | } |
||
| 71 | |||
| 72 | /** |
||
| 73 | * Overwrite import to fill products correctly |
||
| 74 | * |
||
| 75 | * @param \stdClass $object |
||
| 76 | * |
||
| 77 | * @throws \Exception |
||
| 78 | */ |
||
| 79 | public function import($object) |
||
| 95 |