From 117bee1244a0c5d9e22d5868fb39aade57bc0a85 Mon Sep 17 00:00:00 2001 From: Richard Whitehouse Date: Fri, 4 Feb 2011 18:41:36 +0000 Subject: [PATCH] Purchase and Order and Ticket constructors --- index.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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; -- 2.34.1