DataObjects/Core_notify.php
authorAlan Knowles <alan@akbkhome.com>
Fri, 8 Apr 2011 05:00:05 +0000 (13:00 +0800)
committerAlan Knowles <alan@akbkhome.com>
Fri, 8 Apr 2011 05:00:05 +0000 (13:00 +0800)
DataObjects/Core_notify.php

index e69de29..12f0e8d 100644 (file)
@@ -0,0 +1,61 @@
+<?php
+/**
+ *
+ * Table is designed to be used with a mailer to notify or issue
+ * emails (or maybe others later??)
+ *
+ *
+CREATE TABLE  core_notify  (
+  `id` int(11)  NOT NULL AUTO_INCREMENT,
+  `act_when` DATETIME NOT NULL,
+  `onid` int(11)  NOT NULL DEFAULT 0,
+  `ontable` varchar(128)  NOT NULL DEFAULT '',
+  `person_id` int(11)  NOT NULL DEFAULT 0,
+  `msgid` varchar(128)  NOT NULL  DEFAULT '',
+  `sent` DATETIME  NOT NULL,
+  `event_id` int(11)  NOT NULL DEFAULT 0,
+  PRIMARY KEY (`id`),
+  INDEX `lookup`(`act_when`, `msgid`)
+);
+*/
+require_once 'DB/DataObject.php';
+
+class Pman_Core_DataObjects_Core_notify extends DB_DataObject 
+{
+    ###START_AUTOCODE
+    /* the code below is auto generated do not remove the above tag */
+
+    
+    public $__table = 'core_notify';         
+    public $act_when;                        
+    
+    public $ontable;                         
+    public $onid;                            
+    
+    public $person_id;                       
+    
+    public $msgid;   // message id after it has been sent. -- empty if not sent..
+    public $sent;    // date it was sent.?? or last effort..
+    public $bounced; // 1 - failed to send (??) // 2 = we got a bounce.
+
+
+    function person()
+    {
+        $c = DB_DataObject::Factory('Person');
+        $c->get($this->person_id);
+        return $c;
+        
+    }
+    function object()
+    {
+        $c = DB_DataObject::factory($this->ontable);
+        $c->autoJoin();
+        if ($c->get($this->onid)) {
+            return $c;
+        }
+        return false;
+        
+    }
+  
+}
\ No newline at end of file