Merge pull request #23707 from eileenmcnaughton/import_activity
[civicrm-core.git] / CRM / Mailing / DAO / BounceType.php
CommitLineData
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
28979d65 9 * (GenCodeChecksum:ef69aba971b0a118a9ec2238a180c7c5)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the BounceType entity.
f41f0342 14 */
e501603b 15class 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 /**
28979d65
CW
35 * @var int|string|null
36 * (SQL type: int unsigned)
37 * Note that values will be retrieved from the database as a string.
e501603b
TO
38 */
39 public $id;
c3fc2621 40
e501603b
TO
41 /**
42 * Type of bounce
43 *
44 * @var string
28979d65
CW
45 * (SQL type: varchar(24))
46 * Note that values will be retrieved from the database as a string.
e501603b
TO
47 */
48 public $name;
c3fc2621 49
e501603b
TO
50 /**
51 * A description of this bounce type
52 *
28979d65
CW
53 * @var string|null
54 * (SQL type: varchar(255))
55 * Note that values will be retrieved from the database as a string.
e501603b
TO
56 */
57 public $description;
c3fc2621 58
e501603b
TO
59 /**
60 * Number of bounces of this type required before the email address is put on bounce hold
61 *
28979d65
CW
62 * @var int|string
63 * (SQL type: int unsigned)
64 * Note that values will be retrieved from the database as a string.
e501603b
TO
65 */
66 public $hold_threshold;
c3fc2621 67
e501603b 68 /**
f41f0342 69 * Class constructor.
e501603b 70 */
c3fc2621 71 public function __construct() {
e501603b
TO
72 $this->__table = 'civicrm_mailing_bounce_type';
73 parent::__construct();
74 }
c3fc2621 75
449c4e6b
CW
76 /**
77 * Returns localized title of this entity.
7b66c3b5
AH
78 *
79 * @param bool $plural
80 * Whether to return the plural version of the title.
449c4e6b 81 */
7b66c3b5
AH
82 public static function getEntityTitle($plural = FALSE) {
83 return $plural ? ts('Bounce Types') : ts('Bounce Type');
449c4e6b
CW
84 }
85
e501603b
TO
86 /**
87 * Returns all the column names of this table
88 *
89 * @return array
90 */
c3fc2621 91 public static function &fields() {
346aaaba 92 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
93 Civi::$statics[__CLASS__]['fields'] = [
94 'id' => [
e501603b
TO
95 'name' => 'id',
96 'type' => CRM_Utils_Type::T_INT,
c3fc2621
CW
97 'title' => ts('Bounce Type ID'),
98 'required' => TRUE,
a36434b9 99 'where' => 'civicrm_mailing_bounce_type.id',
522a26c9 100 'table_name' => 'civicrm_mailing_bounce_type',
101 'entity' => 'BounceType',
102 'bao' => 'CRM_Mailing_DAO_BounceType',
6a7e5e5d 103 'localizable' => 0,
2cbbebe8
A
104 'html' => [
105 'type' => 'Number',
106 ],
1fe423d6 107 'readonly' => TRUE,
a9d0587b 108 'add' => NULL,
c3fc2621
CW
109 ],
110 'name' => [
e501603b
TO
111 'name' => 'name',
112 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 113 'title' => ts('Bounce Type Name'),
215b423e 114 'description' => ts('Type of bounce'),
c3fc2621 115 'required' => TRUE,
e501603b
TO
116 'maxlength' => 24,
117 'size' => CRM_Utils_Type::MEDIUM,
a36434b9 118 'where' => 'civicrm_mailing_bounce_type.name',
522a26c9 119 'table_name' => 'civicrm_mailing_bounce_type',
120 'entity' => 'BounceType',
121 'bao' => 'CRM_Mailing_DAO_BounceType',
6a7e5e5d 122 'localizable' => 0,
a9d0587b 123 'add' => NULL,
c3fc2621
CW
124 ],
125 'description' => [
e501603b
TO
126 'name' => 'description',
127 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 128 'title' => ts('Bounce Type Description'),
215b423e 129 'description' => ts('A description of this bounce type'),
e501603b
TO
130 'maxlength' => 255,
131 'size' => CRM_Utils_Type::HUGE,
a36434b9 132 'where' => 'civicrm_mailing_bounce_type.description',
522a26c9 133 'table_name' => 'civicrm_mailing_bounce_type',
134 'entity' => 'BounceType',
135 'bao' => 'CRM_Mailing_DAO_BounceType',
6a7e5e5d 136 'localizable' => 0,
a9d0587b 137 'add' => NULL,
c3fc2621
CW
138 ],
139 'hold_threshold' => [
e501603b
TO
140 'name' => 'hold_threshold',
141 'type' => CRM_Utils_Type::T_INT,
c3fc2621 142 'title' => ts('Hold Threshold'),
215b423e 143 'description' => ts('Number of bounces of this type required before the email address is put on bounce hold'),
c3fc2621 144 'required' => TRUE,
a36434b9 145 'where' => 'civicrm_mailing_bounce_type.hold_threshold',
522a26c9 146 'table_name' => 'civicrm_mailing_bounce_type',
147 'entity' => 'BounceType',
148 'bao' => 'CRM_Mailing_DAO_BounceType',
6a7e5e5d 149 'localizable' => 0,
a9d0587b 150 'add' => NULL,
c3fc2621
CW
151 ],
152 ];
346aaaba 153 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 154 }
346aaaba 155 return Civi::$statics[__CLASS__]['fields'];
e501603b 156 }
c3fc2621 157
e501603b 158 /**
bd8e0b14 159 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
160 *
161 * @return array
bd8e0b14 162 * Array(string $name => string $uniqueName).
e501603b 163 */
c3fc2621 164 public static function &fieldKeys() {
bd8e0b14
TO
165 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
166 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 167 }
bd8e0b14 168 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 169 }
c3fc2621 170
e501603b
TO
171 /**
172 * Returns the names of this table
173 *
174 * @return string
175 */
c3fc2621 176 public static function getTableName() {
e501603b
TO
177 return self::$_tableName;
178 }
c3fc2621 179
e501603b
TO
180 /**
181 * Returns if this table needs to be logged
182 *
c3fc2621 183 * @return bool
e501603b 184 */
c3fc2621 185 public function getLog() {
e501603b
TO
186 return self::$_log;
187 }
c3fc2621 188
e501603b
TO
189 /**
190 * Returns the list of fields that can be imported
191 *
192 * @param bool $prefix
193 *
194 * @return array
195 */
c3fc2621
CW
196 public static function &import($prefix = FALSE) {
197 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_bounce_type', $prefix, []);
60808919 198 return $r;
e501603b 199 }
c3fc2621 200
e501603b
TO
201 /**
202 * Returns the list of fields that can be exported
203 *
204 * @param bool $prefix
205 *
206 * @return array
207 */
c3fc2621
CW
208 public static function &export($prefix = FALSE) {
209 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_bounce_type', $prefix, []);
60808919 210 return $r;
e501603b 211 }
c3fc2621 212
e7a6b91a
AS
213 /**
214 * Returns the list of indices
c3fc2621
CW
215 *
216 * @param bool $localize
217 *
218 * @return array
e7a6b91a
AS
219 */
220 public static function indices($localize = TRUE) {
c3fc2621 221 $indices = [];
e7a6b91a
AS
222 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
223 }
c3fc2621 224
e501603b 225}