Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
ca5cec67 | 5 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Mailing/BounceType.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
8ab43c93 | 9 | * (GenCodeChecksum:d85cecf66659cee08c967e8671ba7b6d) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the BounceType entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Mailing_DAO_BounceType extends CRM_Core_DAO { |
929a1c14 CW |
16 | const EXT = 'civicrm'; |
17 | const TABLE_ADDED = ''; | |
d31fb4e3 | 18 | const COMPONENT = 'CiviMail'; |
c3fc2621 | 19 | |
e501603b | 20 | /** |
f41f0342 | 21 | * Static instance to hold the table name. |
e501603b TO |
22 | * |
23 | * @var string | |
24 | */ | |
fa45b5b9 | 25 | public static $_tableName = 'civicrm_mailing_bounce_type'; |
c3fc2621 | 26 | |
e501603b | 27 | /** |
f41f0342 | 28 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 29 | * |
c3fc2621 | 30 | * @var bool |
e501603b | 31 | */ |
fa45b5b9 | 32 | public static $_log = FALSE; |
c3fc2621 | 33 | |
e501603b | 34 | /** |
e6ca0a57 | 35 | * @var int |
e501603b TO |
36 | */ |
37 | public $id; | |
c3fc2621 | 38 | |
e501603b TO |
39 | /** |
40 | * Type of bounce | |
41 | * | |
42 | * @var string | |
43 | */ | |
44 | public $name; | |
c3fc2621 | 45 | |
e501603b TO |
46 | /** |
47 | * A description of this bounce type | |
48 | * | |
49 | * @var string | |
50 | */ | |
51 | public $description; | |
c3fc2621 | 52 | |
e501603b TO |
53 | /** |
54 | * Number of bounces of this type required before the email address is put on bounce hold | |
55 | * | |
e6ca0a57 | 56 | * @var int |
e501603b TO |
57 | */ |
58 | public $hold_threshold; | |
c3fc2621 | 59 | |
e501603b | 60 | /** |
f41f0342 | 61 | * Class constructor. |
e501603b | 62 | */ |
c3fc2621 | 63 | public function __construct() { |
e501603b TO |
64 | $this->__table = 'civicrm_mailing_bounce_type'; |
65 | parent::__construct(); | |
66 | } | |
c3fc2621 | 67 | |
449c4e6b CW |
68 | /** |
69 | * Returns localized title of this entity. | |
7b66c3b5 AH |
70 | * |
71 | * @param bool $plural | |
72 | * Whether to return the plural version of the title. | |
449c4e6b | 73 | */ |
7b66c3b5 AH |
74 | public static function getEntityTitle($plural = FALSE) { |
75 | return $plural ? ts('Bounce Types') : ts('Bounce Type'); | |
449c4e6b CW |
76 | } |
77 | ||
e501603b TO |
78 | /** |
79 | * Returns all the column names of this table | |
80 | * | |
81 | * @return array | |
82 | */ | |
c3fc2621 | 83 | public static function &fields() { |
346aaaba | 84 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
85 | Civi::$statics[__CLASS__]['fields'] = [ |
86 | 'id' => [ | |
e501603b TO |
87 | 'name' => 'id', |
88 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 CW |
89 | 'title' => ts('Bounce Type ID'), |
90 | 'required' => TRUE, | |
a36434b9 | 91 | 'where' => 'civicrm_mailing_bounce_type.id', |
522a26c9 | 92 | 'table_name' => 'civicrm_mailing_bounce_type', |
93 | 'entity' => 'BounceType', | |
94 | 'bao' => 'CRM_Mailing_DAO_BounceType', | |
6a7e5e5d | 95 | 'localizable' => 0, |
a9d0587b | 96 | 'add' => NULL, |
c3fc2621 CW |
97 | ], |
98 | 'name' => [ | |
e501603b TO |
99 | 'name' => 'name', |
100 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 101 | 'title' => ts('Bounce Type Name'), |
215b423e | 102 | 'description' => ts('Type of bounce'), |
c3fc2621 | 103 | 'required' => TRUE, |
e501603b TO |
104 | 'maxlength' => 24, |
105 | 'size' => CRM_Utils_Type::MEDIUM, | |
a36434b9 | 106 | 'where' => 'civicrm_mailing_bounce_type.name', |
522a26c9 | 107 | 'table_name' => 'civicrm_mailing_bounce_type', |
108 | 'entity' => 'BounceType', | |
109 | 'bao' => 'CRM_Mailing_DAO_BounceType', | |
6a7e5e5d | 110 | 'localizable' => 0, |
a9d0587b | 111 | 'add' => NULL, |
c3fc2621 CW |
112 | ], |
113 | 'description' => [ | |
e501603b TO |
114 | 'name' => 'description', |
115 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 116 | 'title' => ts('Bounce Type Description'), |
215b423e | 117 | 'description' => ts('A description of this bounce type'), |
e501603b TO |
118 | 'maxlength' => 255, |
119 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 120 | 'where' => 'civicrm_mailing_bounce_type.description', |
522a26c9 | 121 | 'table_name' => 'civicrm_mailing_bounce_type', |
122 | 'entity' => 'BounceType', | |
123 | 'bao' => 'CRM_Mailing_DAO_BounceType', | |
6a7e5e5d | 124 | 'localizable' => 0, |
a9d0587b | 125 | 'add' => NULL, |
c3fc2621 CW |
126 | ], |
127 | 'hold_threshold' => [ | |
e501603b TO |
128 | 'name' => 'hold_threshold', |
129 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 130 | 'title' => ts('Hold Threshold'), |
215b423e | 131 | 'description' => ts('Number of bounces of this type required before the email address is put on bounce hold'), |
c3fc2621 | 132 | 'required' => TRUE, |
a36434b9 | 133 | 'where' => 'civicrm_mailing_bounce_type.hold_threshold', |
522a26c9 | 134 | 'table_name' => 'civicrm_mailing_bounce_type', |
135 | 'entity' => 'BounceType', | |
136 | 'bao' => 'CRM_Mailing_DAO_BounceType', | |
6a7e5e5d | 137 | 'localizable' => 0, |
a9d0587b | 138 | 'add' => NULL, |
c3fc2621 CW |
139 | ], |
140 | ]; | |
346aaaba | 141 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 142 | } |
346aaaba | 143 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 144 | } |
c3fc2621 | 145 | |
e501603b | 146 | /** |
bd8e0b14 | 147 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
148 | * |
149 | * @return array | |
bd8e0b14 | 150 | * Array(string $name => string $uniqueName). |
e501603b | 151 | */ |
c3fc2621 | 152 | public static function &fieldKeys() { |
bd8e0b14 TO |
153 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
154 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 155 | } |
bd8e0b14 | 156 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 157 | } |
c3fc2621 | 158 | |
e501603b TO |
159 | /** |
160 | * Returns the names of this table | |
161 | * | |
162 | * @return string | |
163 | */ | |
c3fc2621 | 164 | public static function getTableName() { |
e501603b TO |
165 | return self::$_tableName; |
166 | } | |
c3fc2621 | 167 | |
e501603b TO |
168 | /** |
169 | * Returns if this table needs to be logged | |
170 | * | |
c3fc2621 | 171 | * @return bool |
e501603b | 172 | */ |
c3fc2621 | 173 | public function getLog() { |
e501603b TO |
174 | return self::$_log; |
175 | } | |
c3fc2621 | 176 | |
e501603b TO |
177 | /** |
178 | * Returns the list of fields that can be imported | |
179 | * | |
180 | * @param bool $prefix | |
181 | * | |
182 | * @return array | |
183 | */ | |
c3fc2621 CW |
184 | public static function &import($prefix = FALSE) { |
185 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_bounce_type', $prefix, []); | |
60808919 | 186 | return $r; |
e501603b | 187 | } |
c3fc2621 | 188 | |
e501603b TO |
189 | /** |
190 | * Returns the list of fields that can be exported | |
191 | * | |
192 | * @param bool $prefix | |
193 | * | |
194 | * @return array | |
195 | */ | |
c3fc2621 CW |
196 | public static function &export($prefix = FALSE) { |
197 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_bounce_type', $prefix, []); | |
60808919 | 198 | return $r; |
e501603b | 199 | } |
c3fc2621 | 200 | |
e7a6b91a AS |
201 | /** |
202 | * Returns the list of indices | |
c3fc2621 CW |
203 | * |
204 | * @param bool $localize | |
205 | * | |
206 | * @return array | |
e7a6b91a AS |
207 | */ |
208 | public static function indices($localize = TRUE) { | |
c3fc2621 | 209 | $indices = []; |
e7a6b91a AS |
210 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
211 | } | |
c3fc2621 | 212 | |
e501603b | 213 | } |