From: Richard Whitehouse Date: Fri, 4 Feb 2011 23:34:48 +0000 (+0000) Subject: Add basic functions to purchase X-Git-Url: https://git.richardwhiuk.com/?a=commitdiff_plain;h=988310010fbe4c4ef5e8b127cfdbc5adf373bbe9;p=hmb.git Add basic functions to purchase --- diff --git a/index.php b/index.php index 9c49d77..a2efad1 100644 --- a/index.php +++ b/index.php @@ -246,6 +246,34 @@ class Purchase { $this->name = $name; } + public function id(){ + if(!isset($this->id)){ + throw new Exception('Invalid Operation'); + } + return $this->id; + } + + public function name(){ + if(!isset($this->name)){ + throw new Exception('Invalid Operation'); + } + return $this->name; + } + + public function price(){ + if(!isset($this->price)){ + throw new Exception('Invalid Operation'); + } + return $this->price; + } + + public function ticket(){ + if(!isset($this->ticket)){ + throw new Exception('Invalid Operation'); + } + return $this->ticket; + } + private $id; private $ticket; private $order;