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