From 988310010fbe4c4ef5e8b127cfdbc5adf373bbe9 Mon Sep 17 00:00:00 2001 From: Richard Whitehouse Date: Fri, 4 Feb 2011 23:34:48 +0000 Subject: [PATCH] Add basic functions to purchase --- index.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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; -- 2.34.1