the browser-facing portion of osu!
at master 862 B view raw
1<?php 2 3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. 4// See the LICENCE file in the repository root for full licence text. 5 6namespace App\Exceptions; 7 8use App\Models\Store\Order; 9use Exception; 10 11/** 12 * Exception for when the order is not modifiable. 13 * The exception message should be safe to display to the user. 14 */ 15class OrderNotModifiableException extends Exception 16{ 17 private $order; 18 19 public function __construct(Order $order) 20 { 21 $key = "store.order.not_modifiable_exception.{$order->status}"; 22 $trans = osu_trans($key); 23 24 parent::__construct( 25 $trans === $key ? osu_trans('store.order.not_modifiable_exception.default') : $trans 26 ); 27 28 $this->order = $order; 29 } 30 31 public function getOrder() 32 { 33 return $this->order; 34 } 35}