4 * Table is designed to be used with a mailer to notify or issue
5 * emails (or maybe others later??)
8 CREATE TABLE core_notify (
9 `id` int(11) NOT NULL AUTO_INCREMENT,
10 `act_when` DATETIME NOT NULL,
11 `onid` int(11) NOT NULL DEFAULT 0,
12 `ontable` varchar(128) NOT NULL DEFAULT '',
13 `person_id` int(11) NOT NULL DEFAULT 0,
14 `msgid` varchar(128) NOT NULL DEFAULT '',
15 `sent` DATETIME NOT NULL,
16 `event_id` int(11) NOT NULL DEFAULT 0,
18 INDEX `lookup`(`act_when`, `msgid`)
22 require_once 'DB/DataObject.php';
24 class Pman_Core_DataObjects_Core_notify extends DB_DataObject
27 /* the code below is auto generated do not remove the above tag */
29 public $__table = 'core_notify'; // table name
30 public $id; // int(11) not_null primary_key auto_increment
31 public $act_when; // datetime(19) not_null multiple_key binary
32 public $onid; // int(11) not_null
33 public $ontable; // string(128) not_null
34 public $person_id; // int(11) not_null
35 public $msgid; // string(128) not_null
36 public $sent; // datetime(19) not_null binary
37 public $event_id; // int(11)
40 /* the code above is auto generated do not remove the tag below */
43 function person($set = false)
46 $this->person_id = is_object($set) ? $set->id : $set;
49 $c = DB_DataObject::Factory('Person');
50 $c->get($this->person_id);
54 function object($set = false)
57 $this->ontable = $set->tableName();
58 $this->onid = $set->id;
61 $c = DB_DataObject::factory($this->ontable);
63 if ($c->get($this->onid)) {
72 $c = DB_DataObject::factory('Events');
74 if ($c->get($this->event_id)) {
82 return !empty($msgid);
85 function status() // used by commandline reporting at present..
87 switch($this->event_id) {
94 if (strtotime($this->act_when) > time()) {
95 $p = "RETRY: {$this->act_when} ";
97 return $p. $this->event()->remarks;