From ea99045825bbba22f66f5cc4e4991786687eddd8 Mon Sep 17 00:00:00 2001 From: Richard Whitehouse Date: Fri, 4 Feb 2011 23:40:10 +0000 Subject: [PATCH] Add Ticket::Get --- index.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/index.php b/index.php index fc38e79..d8fb165 100644 --- a/index.php +++ b/index.php @@ -212,6 +212,20 @@ class Ticket { return $count; } + public static function Get($id){ + $query = 'SELECT `id`,`type`,`status` FROM `ticket` WHERE `id` = ? LIMIT 1'; + $stmt = Ticketing::Get()->database()->prepare($query); + $stmt->bind_param('i', $type); + $stmt->execute(); + $stmt->bind_result($id, $type, $status); + $ticket = null; + if($stmt->fetch()){ + $ticket = new Ticket($id, $type, $status);; + } + $stmt->close(); + return $ticket; + } + public static function Allocate_Available($type){ if($type instanceof Type){ $type = $type->id(); -- 2.34.1