d60cfc5f3607aa04d4d329a1f31735ec07d96258
[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             'sender is listed on the block mail' // 'sniper? 
24         );
25         foreach($match as $str) {
26             if (strpos($err, $str) !== false) {
27                 return true;
28             }
29         }
30         return false;
31     }
32     
33     // delete blacklists older than 1 week (and try again)
34     function prune()
35     {
36         $this->query("
37             DELETE FROM {$this->tableName()} where added_dt < NOW()  - INTERVAL 1 WEEK
38         ");
39             
40     }
41     
42 }