fix #8131 - chinese translations
[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             'sender is in my black list',
25         );
26         foreach($match as $str) {
27             if (strpos($err, $str) !== false) {
28                 return true;
29             }
30         }
31         return false;
32     }
33     
34     // delete blacklists older than 1 week (and try again)
35     function prune()
36     {
37         $this->query("
38             DELETE FROM {$this->tableName()} where added_dt < NOW()  - INTERVAL 1 WEEK
39         ");
40             
41     }
42     
43 }