Merge pull request #11142 from JMAConsulting/CRM-21260
[civicrm-core.git] / CRM / Mailing / DAO / BounceType.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
0f03f337 5 * @copyright CiviCRM LLC (c) 2004-2017
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Mailing/BounceType.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
022785d8 9 * (GenCodeChecksum:58e082dadf7a5125e5c34d0f9cffb0f1)
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 {
c3fc2621 16
e501603b 17 /**
f41f0342 18 * Static instance to hold the table name.
e501603b
TO
19 *
20 * @var string
21 */
22 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 */
c3fc2621
CW
29 static $_log = FALSE;
30
e501603b 31 /**
e501603b
TO
32 * @var int unsigned
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 *
53 * @var int unsigned
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,
522a26c9 78 'table_name' => 'civicrm_mailing_bounce_type',
79 'entity' => 'BounceType',
80 'bao' => 'CRM_Mailing_DAO_BounceType',
6a7e5e5d 81 'localizable' => 0,
c3fc2621
CW
82 ],
83 'name' => [
e501603b
TO
84 'name' => 'name',
85 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 86 'title' => ts('Bounce Type Name'),
e501603b 87 'description' => 'Type of bounce',
c3fc2621 88 'required' => TRUE,
e501603b
TO
89 'maxlength' => 24,
90 'size' => CRM_Utils_Type::MEDIUM,
522a26c9 91 'table_name' => 'civicrm_mailing_bounce_type',
92 'entity' => 'BounceType',
93 'bao' => 'CRM_Mailing_DAO_BounceType',
6a7e5e5d 94 'localizable' => 0,
c3fc2621
CW
95 ],
96 'description' => [
e501603b
TO
97 'name' => 'description',
98 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 99 'title' => ts('Bounce Type Description'),
e501603b
TO
100 'description' => 'A description of this bounce type',
101 'maxlength' => 255,
102 'size' => CRM_Utils_Type::HUGE,
522a26c9 103 'table_name' => 'civicrm_mailing_bounce_type',
104 'entity' => 'BounceType',
105 'bao' => 'CRM_Mailing_DAO_BounceType',
6a7e5e5d 106 'localizable' => 0,
c3fc2621
CW
107 ],
108 'hold_threshold' => [
e501603b
TO
109 'name' => 'hold_threshold',
110 'type' => CRM_Utils_Type::T_INT,
c3fc2621 111 'title' => ts('Hold Threshold'),
e501603b 112 'description' => 'Number of bounces of this type required before the email address is put on bounce hold',
c3fc2621 113 'required' => TRUE,
522a26c9 114 'table_name' => 'civicrm_mailing_bounce_type',
115 'entity' => 'BounceType',
116 'bao' => 'CRM_Mailing_DAO_BounceType',
6a7e5e5d 117 'localizable' => 0,
c3fc2621
CW
118 ],
119 ];
346aaaba 120 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 121 }
346aaaba 122 return Civi::$statics[__CLASS__]['fields'];
e501603b 123 }
c3fc2621 124
e501603b 125 /**
bd8e0b14 126 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
127 *
128 * @return array
bd8e0b14 129 * Array(string $name => string $uniqueName).
e501603b 130 */
c3fc2621 131 public static function &fieldKeys() {
bd8e0b14
TO
132 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
133 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 134 }
bd8e0b14 135 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 136 }
c3fc2621 137
e501603b
TO
138 /**
139 * Returns the names of this table
140 *
141 * @return string
142 */
c3fc2621 143 public static function getTableName() {
e501603b
TO
144 return self::$_tableName;
145 }
c3fc2621 146
e501603b
TO
147 /**
148 * Returns if this table needs to be logged
149 *
c3fc2621 150 * @return bool
e501603b 151 */
c3fc2621 152 public function getLog() {
e501603b
TO
153 return self::$_log;
154 }
c3fc2621 155
e501603b
TO
156 /**
157 * Returns the list of fields that can be imported
158 *
159 * @param bool $prefix
160 *
161 * @return array
162 */
c3fc2621
CW
163 public static function &import($prefix = FALSE) {
164 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_bounce_type', $prefix, []);
60808919 165 return $r;
e501603b 166 }
c3fc2621 167
e501603b
TO
168 /**
169 * Returns the list of fields that can be exported
170 *
171 * @param bool $prefix
172 *
173 * @return array
174 */
c3fc2621
CW
175 public static function &export($prefix = FALSE) {
176 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_bounce_type', $prefix, []);
60808919 177 return $r;
e501603b 178 }
c3fc2621 179
e7a6b91a
AS
180 /**
181 * Returns the list of indices
c3fc2621
CW
182 *
183 * @param bool $localize
184 *
185 * @return array
e7a6b91a
AS
186 */
187 public static function indices($localize = TRUE) {
c3fc2621 188 $indices = [];
e7a6b91a
AS
189 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
190 }
c3fc2621 191
e501603b 192}