From: Richard Whitehouse Date: Fri, 4 Feb 2011 18:41:36 +0000 (+0000) Subject: Purchase and Order and Ticket constructors X-Git-Url: https://git.richardwhiuk.com/?a=commitdiff_plain;h=117bee1244a0c5d9e22d5868fb39aade57bc0a85;p=hmb.git Purchase and Order and Ticket constructors --- diff --git a/index.php b/index.php index 498eb50..375f6b4 100644 --- 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;