Purchase and Order and Ticket constructors
authorRichard Whitehouse <richardwhiuk@richardwhiuk.com>
Fri, 4 Feb 2011 18:41:36 +0000 (18:41 +0000)
committerRichard Whitehouse <richardwhiuk@richardwhiuk.com>
Fri, 4 Feb 2011 18:41:36 +0000 (18:41 +0000)
index.php

index 498eb5022f4dcf53f7c80781522a0c4f3b7a2aa0..375f6b44f8d538db7a8d5aa72b5964e0c0e1163c 100644 (file)
--- a/index.php
+++ b/index.php
@@ -181,6 +181,12 @@ class Ticket {
        private $type;
        private $status;
 
+       public function __construct($id, $type, $status){
+               $this->id = $id;
+               $this->type = $type;
+               $this->status = $status;
+       }
+
        public function id(){
                if(!isset($this->id)){
                        throw new Exception('Invalid Operation');
@@ -228,6 +234,14 @@ class Ticket {
 
 class Purchase {
 
+       public function __construct($id, $order, $ticket, $price, $name){
+               $this->id = $id;
+               $this->ticket = $ticket;
+               $this->order = $order;
+               $this->price = $price;
+               $this->name = $name;
+       }
+
        private $id;
        private $ticket;
        private $order;
@@ -251,6 +265,13 @@ class Purchase {
 
 class Order {
 
+       public function __construct($id, $user, $time, $status){
+               $this->id = $id;
+               $this->status = $status;
+               $this->user = $user;
+               $this->time = $time;
+       }
+
        private $id;
        private $user;
        private $time;