. */ /** * An abstract interface to a database table related to offers */ abstract class OfferItem extends Model implements Calculatable { /** * Get the offer that this assignment 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); } /** {@inheritDoc} */ public function calculateVAT() { return $this->calculateSubtotal() * $this->VAT_percentage / 100; } }