DataObjects/Core_notify_recur.php
[Pman.Core] / DataObjects / Projects.php
index 39af207..64ce9b4 100644 (file)
@@ -157,6 +157,7 @@ class Pman_Core_DataObjects_Projects extends DB_DataObject
         
         // this is clipping related..  -- we should have an API for addons like this.. (and docs)
         
+       
         
         
         
@@ -296,27 +297,33 @@ class Pman_Core_DataObjects_Projects extends DB_DataObject
             ));
         }
         return true;
-    } 
+    }
+    
+    
     /**
      * fetch a list of user projects.
      * if you need to filter open/closed.. then add whereAdds before calling
      */
-    function getUserProjects($au, $data='id') // COMPANY BASED!!!!
+    function userProjects($au, $data='id') // COMPANY BASED!!!!
     {
+        
         $id = (int) $au->company_id;
+        
         $this->whereAdd("
             (client_id= $id) OR (agency_id= $id)
         ");
-        if (!empty($data)) {
-            $this->selectAdd();
-            $this->selectAdd($data);
-        }
-        $this->find();
-        $ret = array();
-        while ($this->fetch()) {
-            $ret[] = empty($data) ? clone($this) : $this->$data;
-        }
-        return $ret;
+        
+        return empty($data) ? $this->fetchAll() :$this->fetchAll($data); 
+         
+            
+    }
+    
+    // DEPRICATED - use userProjects
+    
+    function getUserProjects($au, $data='id') // COMPANY BASED!!!!
+    {
+        return $this->userProjects($au, $data);
+         
             
     }