Add basic functions to purchase
authorRichard Whitehouse <richardwhiuk@richardwhiuk.com>
Fri, 4 Feb 2011 23:34:48 +0000 (23:34 +0000)
committerRichard Whitehouse <richardwhiuk@richardwhiuk.com>
Fri, 4 Feb 2011 23:34:48 +0000 (23:34 +0000)
index.php

index 9c49d7730f90805cf3eb2e75b610e0fa4c05c192..a2efad1682eb28d4182a6c5fe05b2695d359e9d4 100644 (file)
--- 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;