+
+ }
+ /**
+ * project id's for a user.
+ * @param DB_DataObject_Core_Person|array - who, or list of people.
+ * @return array id's of the project they are a member of..
+ */
+ function projects($au)
+ {
+ if (empty($au)) {
+ $p = DB_DataObject::Factory('core_project');
+ $p->get('code', '*PUBLIC');
+ return array($p->id);
+
+ }
+ $c = clone ($this);
+
+ if (is_array($au)) {
+ $c->whereAddIn('person_id', $au, 'int');
+ } else {
+ $c->person_id = $au->id;
+ }
+ $c->selectAdd();
+ // people may have multiple roles for a project..
+ $c->selectAdd("distinct({$this->tableName()}.project_id) as project_id");
+ return $c->fetchAll('project_id');
+ }
+ /**
+ * project id's for a user.
+ * @param DB_DataObject_Core_Person - who
+ * @return array id's of the project they are a member of..
+ */
+ function people($pr)
+ {
+ $c = clone ($this);
+ //echo '<PRE>';print_R($this);exit;