// this is clipping related.. -- we should have an API for addons like this.. (and docs)
+
));
}
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);
+
}