NotifySend.php
authorAlan Knowles <alan@akkbhome.com>
Wed, 6 Apr 2011 15:08:52 +0000 (23:08 +0800)
committerAlan Knowles <alan@akkbhome.com>
Wed, 6 Apr 2011 15:08:52 +0000 (23:08 +0800)
NotifySend.php

index 0f79f71..f217704 100644 (file)
@@ -45,6 +45,18 @@ class Pman_Core_NotifySend extends Pman
         $o = $w->object();
         $p = $w->person();
         
+        // let's work out the last notification sent to this user..
+        $l = DB_DataObject::factory($this->table);
+        $l->setFrom($w->toArray());
+        unset($l->sent);
+        unset($l->act_when);
+        $l->whereAdd('id != '. $w->id);
+        $l->orderBy('sent DESC');
+        $l->limit(1);
+        $ar = $l->fetchAll('sent');
+        $last = empty($ar) ? date('Y-m-d H:i:s', 0) : $ar['sent'];
+        
+        
         $email = $o->toEmail($p,)
         // should we fetch the watch that caused it.. - which should contain the method to call..