sync
[Pman.Core] / DataObjects / Core_notify_sender_blacklist.php
1 <?php
2 /**
3  * Table Definition for core_notify_sender_blacklist
4  */
5 class_exists('DB_DataObject') ? '' : require_once 'DB/DataObject.php';
6
7 class Pman_Core_DataObjects_Core_notify_sender_blacklist extends DB_DataObject 
8 {
9     ###START_AUTOCODE
10     /* the code below is auto generated do not remove the above tag */
11
12     public $__table = 'core_notify_sender_blacklist';    // table name
13     public $id;                              // int(11)  not_null primary_key auto_increment
14     public $sender_id;
15     public $domain_id;
16     public $error_msg;
17     public $added_dt;
18      
19     function messageIsBlacklisted($err)
20     {
21         $match = array(
22             'BLOCK-SEND-ER'
23         );
24         foreach($match as $str) {
25             if (strpos($err, $str) !== false) {
26                 return true;
27             }
28         }
29         return false;
30     }
31     
32     // delete blacklists older than 1 week (and try again)
33     function prune()
34     {
35         $this->query("
36             DELETE FROM {$this->tableName()} where added_dt < NOW()  - INTERVAL 1 WEEK
37         ");
38             
39     }
40     
41 }