DataObjects/Companies.php
authorAlan Knowles <alan@roojs.com>
Wed, 12 Sep 2012 07:57:19 +0000 (15:57 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 12 Sep 2012 07:57:19 +0000 (15:57 +0800)
DataObjects/Companies.php

index 0764d35..98e0058 100644 (file)
@@ -288,6 +288,21 @@ class Pman_Core_DataObjects_Companies extends DB_DataObject
         return $fm->toHTML($size, $base);
     }
     
+    function toRooSingleArray($authUser, $request)
+    {
+        $ret = $this->toArray();
+        // get the comptype display
+        $e = DB_DataObject::Factory('core_enum');
+        $e->etype = 'COMPTYPE';
+        $e->name = $this->comptype;
+        $ret['comptype_display'] = $ret['comptype'];
+        if ($e->find(true) && !empty($e->name_display)) {
+            $ret['comptype_display'] = $e->name_display;
+        }
+        
+        
+        return $ret;
+    }
     
     
 }