{
if ($set !== false) {
$this->person_table = is_object($set) ? $set->tableName() : '';
- $this->person_id = is_object($set) ? $set->id : $set;
+
+ $person_table = empty($this->person_table) ? 'Person' : $this->person_table;
+ $col = $person_table == "Person" ? 'person_id' : $person_table . '_id';
+
+ $this->{$col} = is_object($set) ? $set->id : $set;
return;
}
static $cache =array();
}
}
+ /**
+ * current state of process
+ *
+ * 0 = pending
+ * 1 = delivered
+ * -1 = failed
+ *
+ *
+ */
+ function state()
+ {
+
+ if ($this->msgid != '') {
+ return 1;
+ }
+
+ // msgid is empty now..
+ // if act_when is greater than now, then it's still pending.
+ if (strtotime($this->act_when) > time()) {
+ return 0;
+ }
+
+ // event id can be filled in with a failed attempt.
+
+ if ($this->event_id > 0) {
+ return -1;
+ }
+
+ // event id is empty, and act_when is in the past... not sent yet..
+
+ return 0; // pending
+
+
+ }
+
function applyFilters($q, $au, $roo)
{