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