API/DAO Metadata - Retain versioning metadata for possible usage in runtime+tooling
[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
a9d0587b 9 * (GenCodeChecksum:b2b6ab45aa6fed676d81a68651f0bf93)
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 */
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
449c4e6b
CW
65 /**
66 * Returns localized title of this entity.
67 */
68 public static function getEntityTitle() {
69 return ts('Bounce Types');
70 }
71
e501603b
TO
72 /**
73 * Returns all the column names of this table
74 *
75 * @return array
76 */
c3fc2621 77 public static function &fields() {
346aaaba 78 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
79 Civi::$statics[__CLASS__]['fields'] = [
80 'id' => [
e501603b
TO
81 'name' => 'id',
82 'type' => CRM_Utils_Type::T_INT,
c3fc2621
CW
83 'title' => ts('Bounce Type ID'),
84 'required' => TRUE,
a36434b9 85 'where' => 'civicrm_mailing_bounce_type.id',
522a26c9 86 'table_name' => 'civicrm_mailing_bounce_type',
87 'entity' => 'BounceType',
88 'bao' => 'CRM_Mailing_DAO_BounceType',
6a7e5e5d 89 'localizable' => 0,
a9d0587b 90 'add' => NULL,
c3fc2621
CW
91 ],
92 'name' => [
e501603b
TO
93 'name' => 'name',
94 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 95 'title' => ts('Bounce Type Name'),
215b423e 96 'description' => ts('Type of bounce'),
c3fc2621 97 'required' => TRUE,
e501603b
TO
98 'maxlength' => 24,
99 'size' => CRM_Utils_Type::MEDIUM,
a36434b9 100 'where' => 'civicrm_mailing_bounce_type.name',
522a26c9 101 'table_name' => 'civicrm_mailing_bounce_type',
102 'entity' => 'BounceType',
103 'bao' => 'CRM_Mailing_DAO_BounceType',
6a7e5e5d 104 'localizable' => 0,
a9d0587b 105 'add' => NULL,
c3fc2621
CW
106 ],
107 'description' => [
e501603b
TO
108 'name' => 'description',
109 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 110 'title' => ts('Bounce Type Description'),
215b423e 111 'description' => ts('A description of this bounce type'),
e501603b
TO
112 'maxlength' => 255,
113 'size' => CRM_Utils_Type::HUGE,
a36434b9 114 'where' => 'civicrm_mailing_bounce_type.description',
522a26c9 115 'table_name' => 'civicrm_mailing_bounce_type',
116 'entity' => 'BounceType',
117 'bao' => 'CRM_Mailing_DAO_BounceType',
6a7e5e5d 118 'localizable' => 0,
a9d0587b 119 'add' => NULL,
c3fc2621
CW
120 ],
121 'hold_threshold' => [
e501603b
TO
122 'name' => 'hold_threshold',
123 'type' => CRM_Utils_Type::T_INT,
c3fc2621 124 'title' => ts('Hold Threshold'),
215b423e 125 'description' => ts('Number of bounces of this type required before the email address is put on bounce hold'),
c3fc2621 126 'required' => TRUE,
a36434b9 127 'where' => 'civicrm_mailing_bounce_type.hold_threshold',
522a26c9 128 'table_name' => 'civicrm_mailing_bounce_type',
129 'entity' => 'BounceType',
130 'bao' => 'CRM_Mailing_DAO_BounceType',
6a7e5e5d 131 'localizable' => 0,
a9d0587b 132 'add' => NULL,
c3fc2621
CW
133 ],
134 ];
346aaaba 135 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 136 }
346aaaba 137 return Civi::$statics[__CLASS__]['fields'];
e501603b 138 }
c3fc2621 139
e501603b 140 /**
bd8e0b14 141 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
142 *
143 * @return array
bd8e0b14 144 * Array(string $name => string $uniqueName).
e501603b 145 */
c3fc2621 146 public static function &fieldKeys() {
bd8e0b14
TO
147 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
148 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 149 }
bd8e0b14 150 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 151 }
c3fc2621 152
e501603b
TO
153 /**
154 * Returns the names of this table
155 *
156 * @return string
157 */
c3fc2621 158 public static function getTableName() {
e501603b
TO
159 return self::$_tableName;
160 }
c3fc2621 161
e501603b
TO
162 /**
163 * Returns if this table needs to be logged
164 *
c3fc2621 165 * @return bool
e501603b 166 */
c3fc2621 167 public function getLog() {
e501603b
TO
168 return self::$_log;
169 }
c3fc2621 170
e501603b
TO
171 /**
172 * Returns the list of fields that can be imported
173 *
174 * @param bool $prefix
175 *
176 * @return array
177 */
c3fc2621
CW
178 public static function &import($prefix = FALSE) {
179 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_bounce_type', $prefix, []);
60808919 180 return $r;
e501603b 181 }
c3fc2621 182
e501603b
TO
183 /**
184 * Returns the list of fields that can be exported
185 *
186 * @param bool $prefix
187 *
188 * @return array
189 */
c3fc2621
CW
190 public static function &export($prefix = FALSE) {
191 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_bounce_type', $prefix, []);
60808919 192 return $r;
e501603b 193 }
c3fc2621 194
e7a6b91a
AS
195 /**
196 * Returns the list of indices
c3fc2621
CW
197 *
198 * @param bool $localize
199 *
200 * @return array
e7a6b91a
AS
201 */
202 public static function indices($localize = TRUE) {
c3fc2621 203 $indices = [];
e7a6b91a
AS
204 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
205 }
c3fc2621 206
e501603b 207}