| @@ 81-89 (lines=9) @@ | ||
| 78 | ||
| 79 | public function addProduct($ProductClass, $quantity = 1) |
|
| 80 | { |
|
| 81 | if (!$ProductClass instanceof ProductClass) { |
|
| 82 | $ProductClassId = $ProductClass; |
|
| 83 | $ProductClass = $this->em |
|
| 84 | ->getRepository(ProductClass::class) |
|
| 85 | ->find($ProductClassId); |
|
| 86 | if (is_null($ProductClass)) { |
|
| 87 | return false; |
|
| 88 | } |
|
| 89 | } |
|
| 90 | ||
| 91 | /** @var Cart $cart */ |
|
| 92 | $cart = $this->cart; |
|
| @@ 112-120 (lines=9) @@ | ||
| 109 | ||
| 110 | public function removeProduct($ProductClass) |
|
| 111 | { |
|
| 112 | if (!$ProductClass instanceof ProductClass) { |
|
| 113 | $ProductClassId = $ProductClass; |
|
| 114 | $ProductClass = $this->em |
|
| 115 | ->getRepository(ProductClass::class) |
|
| 116 | ->find($ProductClassId); |
|
| 117 | if (is_null($ProductClass)) { |
|
| 118 | return false; |
|
| 119 | } |
|
| 120 | } |
|
| 121 | ||
| 122 | /** @var Cart $cart */ |
|
| 123 | $cart = $this->cart; |
|