| 1 | <?php |
||
| 20 | abstract class NotPurchasableException extends Exception |
||
| 21 | { |
||
| 22 | /** @var AbstractCartPosition|null */ |
||
| 23 | protected $position; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var ShoppingCart |
||
| 27 | */ |
||
| 28 | protected $cart; |
||
| 29 | |||
| 30 | public static function forPosition(AbstractCartPosition $position, ShoppingCart $cart, string $message = '') |
||
| 39 | |||
| 40 | public static function forCart(ShoppingCart $cart, string $message = '') |
||
| 48 | |||
| 49 | public function getName() |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Method SHOULD BE called when exception is caught. |
||
| 56 | * Child classes may override this method and add problem auto-resolving. |
||
| 57 | * |
||
| 58 | * @return bool whether exception was automatically resolved |
||
| 59 | */ |
||
| 60 | public function resolve(): bool |
||
| 64 | } |
||
| 65 |