From 4eb1f57eec9304f2a4d6f204ff4702ab11c4c430 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Thu, 28 Jul 2016 17:27:43 +0200 Subject: Removed duplicate code --- classes/Discount.php | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'classes/Discount.php') diff --git a/classes/Discount.php b/classes/Discount.php index 4084d43..e4f8067 100644 --- a/classes/Discount.php +++ b/classes/Discount.php @@ -24,37 +24,14 @@ /** * An interface to the discount table in the database */ -class Discount extends Model implements Calculatable { +class Discount extends OfferItem { use StandardCalculatable; public $table = 'discount', $fillable_columns = ['offerId', 'title', 'description', 'value', 'VAT_percentage']; - /** - * Get the offer that this discount is linked to - * - * @return offer The offer - */ - public function getOffer() { - return new Offer($this->pdo, $this->offerId); - } - - /** - * The description after having parsed markdown - * - * @return string The description in HTML format - */ - public function getHTMLDescription() { - $pd = new Parsedown; - return $pd->text($this->description); - } - public function calculateSubtotal() { return - $this->value; } - - public function calculateVAT() { - return $this->calculateSubtotal() * $this->VAT_percentage / 100; - } } -- cgit v1.2.3