Merge pull request #21453 from eileenmcnaughton/member_tokens
[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
2562d09a 9 * (GenCodeChecksum:cde25653865971ad7f5692dfd0eb7c39)
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 /**
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,
2cbbebe8
A
96 'html' => [
97 'type' => 'Number',
98 ],
1fe423d6 99 'readonly' => TRUE,
a9d0587b 100 'add' => NULL,
c3fc2621
CW
101 ],
102 'name' => [
e501603b
TO
103 'name' => 'name',
104 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 105 'title' => ts('Bounce Type Name'),
215b423e 106 'description' => ts('Type of bounce'),
c3fc2621 107 'required' => TRUE,
e501603b
TO
108 'maxlength' => 24,
109 'size' => CRM_Utils_Type::MEDIUM,
a36434b9 110 'where' => 'civicrm_mailing_bounce_type.name',
522a26c9 111 'table_name' => 'civicrm_mailing_bounce_type',
112 'entity' => 'BounceType',
113 'bao' => 'CRM_Mailing_DAO_BounceType',
6a7e5e5d 114 'localizable' => 0,
a9d0587b 115 'add' => NULL,
c3fc2621
CW
116 ],
117 'description' => [
e501603b
TO
118 'name' => 'description',
119 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 120 'title' => ts('Bounce Type Description'),
215b423e 121 'description' => ts('A description of this bounce type'),
e501603b
TO
122 'maxlength' => 255,
123 'size' => CRM_Utils_Type::HUGE,
a36434b9 124 'where' => 'civicrm_mailing_bounce_type.description',
522a26c9 125 'table_name' => 'civicrm_mailing_bounce_type',
126 'entity' => 'BounceType',
127 'bao' => 'CRM_Mailing_DAO_BounceType',
6a7e5e5d 128 'localizable' => 0,
a9d0587b 129 'add' => NULL,
c3fc2621
CW
130 ],
131 'hold_threshold' => [
e501603b
TO
132 'name' => 'hold_threshold',
133 'type' => CRM_Utils_Type::T_INT,
c3fc2621 134 'title' => ts('Hold Threshold'),
215b423e 135 'description' => ts('Number of bounces of this type required before the email address is put on bounce hold'),
c3fc2621 136 'required' => TRUE,
a36434b9 137 'where' => 'civicrm_mailing_bounce_type.hold_threshold',
522a26c9 138 'table_name' => 'civicrm_mailing_bounce_type',
139 'entity' => 'BounceType',
140 'bao' => 'CRM_Mailing_DAO_BounceType',
6a7e5e5d 141 'localizable' => 0,
a9d0587b 142 'add' => NULL,
c3fc2621
CW
143 ],
144 ];
346aaaba 145 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 146 }
346aaaba 147 return Civi::$statics[__CLASS__]['fields'];
e501603b 148 }
c3fc2621 149
e501603b 150 /**
bd8e0b14 151 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
152 *
153 * @return array
bd8e0b14 154 * Array(string $name => string $uniqueName).
e501603b 155 */
c3fc2621 156 public static function &fieldKeys() {
bd8e0b14
TO
157 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
158 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 159 }
bd8e0b14 160 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 161 }
c3fc2621 162
e501603b
TO
163 /**
164 * Returns the names of this table
165 *
166 * @return string
167 */
c3fc2621 168 public static function getTableName() {
e501603b
TO
169 return self::$_tableName;
170 }
c3fc2621 171
e501603b
TO
172 /**
173 * Returns if this table needs to be logged
174 *
c3fc2621 175 * @return bool
e501603b 176 */
c3fc2621 177 public function getLog() {
e501603b
TO
178 return self::$_log;
179 }
c3fc2621 180
e501603b
TO
181 /**
182 * Returns the list of fields that can be imported
183 *
184 * @param bool $prefix
185 *
186 * @return array
187 */
c3fc2621
CW
188 public static function &import($prefix = FALSE) {
189 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_bounce_type', $prefix, []);
60808919 190 return $r;
e501603b 191 }
c3fc2621 192
e501603b
TO
193 /**
194 * Returns the list of fields that can be exported
195 *
196 * @param bool $prefix
197 *
198 * @return array
199 */
c3fc2621
CW
200 public static function &export($prefix = FALSE) {
201 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_bounce_type', $prefix, []);
60808919 202 return $r;
e501603b 203 }
c3fc2621 204
e7a6b91a
AS
205 /**
206 * Returns the list of indices
c3fc2621
CW
207 *
208 * @param bool $localize
209 *
210 * @return array
e7a6b91a
AS
211 */
212 public static function indices($localize = TRUE) {
c3fc2621 213 $indices = [];
e7a6b91a
AS
214 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
215 }
c3fc2621 216
e501603b 217}