DataObjects/core.sql
[Pman.Core] / DataObjects / Companies.php
index f368a2b..0b5d8ab 100644 (file)
@@ -45,7 +45,7 @@ class Pman_Core_DataObjects_Companies extends DB_DataObject
         $x = DB_DataObject::factory('Companies');
         $x->comptype= 'OWNER';
         $x->find(true);
-        error_log('inin');
+        
         if (!empty($q['query']['company_project_id'])) {
             $add = '';
             if (!empty($q['query']['company_include_self'])) {
@@ -288,6 +288,22 @@ class Pman_Core_DataObjects_Companies extends DB_DataObject
         return $fm->toHTML($size, $base);
     }
     
+    function toRooSingleArray($authUser, $request)
+    {
+        $ret = $this->toArray();
+       // DB_DataObject::debugLevel(1);
+        // 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;
+    }
     
     
 }