From fb7487abacf43e8003531ce4796cfcad44a4cf69 Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Fri, 7 Sep 2012 09:59:32 -0400
Subject: [PATCH] Support asVar - returns an equivalent of the name of the
 object

---
 include/class.dept.php   |  4 ++++
 include/class.team.php   |  4 ++++
 include/class.ticket.php | 16 +++++++++++++---
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/include/class.dept.php b/include/class.dept.php
index f11a264ec..f11727ba4 100644
--- a/include/class.dept.php
+++ b/include/class.dept.php
@@ -59,6 +59,10 @@ class Dept {
         return $this->load();
     }
 
+    function asVar() {
+        return $this->getName();
+    }
+
     function getId() {
         return $this->id;
     }
diff --git a/include/class.team.php b/include/class.team.php
index 60301e267..7c9ac03f9 100644
--- a/include/class.team.php
+++ b/include/class.team.php
@@ -51,6 +51,10 @@ class Team {
         return $this->load($this->getId());
     }
 
+    function asVar() {
+        return $this->getName();
+    }
+
     function getId() {
         return $this->id;
     }
diff --git a/include/class.ticket.php b/include/class.ticket.php
index 16d55865e..356ff2699 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -25,10 +25,11 @@ include_once(INCLUDE_DIR.'class.attachment.php');
 include_once(INCLUDE_DIR.'class.pdf.php');
 include_once(INCLUDE_DIR.'class.banlist.php');
 include_once(INCLUDE_DIR.'class.template.php');
+include_once(INCLUDE_DIR.'class.variable.php');
 include_once(INCLUDE_DIR.'class.priority.php');
 include_once(INCLUDE_DIR.'class.sla.php');
 
-class Ticket{
+class Ticket {
 
     var $id;
     var $extid;
@@ -197,14 +198,23 @@ class Ticket{
             && $client->getTicketId()==$this->getExtId());
     }
 
+    //.
+    function asVar() {
+        return $this->getNumber();
+    }
+   
     //Getters
-    function getId(){
+    function getId() {
         return  $this->id;
     }
 
-    function getExtId(){
+    function getExtId() {
         return  $this->extid;
     }
+
+    function getNumber() {
+        return $this->getExtId();
+    }
    
     function getEmail(){
         return $this->email;
-- 
GitLab