Merge pull request #20561 from WeMoveEU/fix/double-autosave
[civicrm-core.git] / CRM / Mailing / DAO / BouncePattern.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/BouncePattern.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
2562d09a 9 * (GenCodeChecksum:c69a86cc75621a05e32951247e12f06b)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the BouncePattern entity.
f41f0342 14 */
e501603b 15class CRM_Mailing_DAO_BouncePattern 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_pattern';
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 *
e6ca0a57 42 * @var int
e501603b
TO
43 */
44 public $bounce_type_id;
c3fc2621 45
e501603b
TO
46 /**
47 * A regexp to match a message to a bounce type
48 *
49 * @var string
50 */
51 public $pattern;
c3fc2621 52
e501603b 53 /**
f41f0342 54 * Class constructor.
e501603b 55 */
c3fc2621 56 public function __construct() {
e501603b
TO
57 $this->__table = 'civicrm_mailing_bounce_pattern';
58 parent::__construct();
59 }
c3fc2621 60
449c4e6b
CW
61 /**
62 * Returns localized title of this entity.
7b66c3b5
AH
63 *
64 * @param bool $plural
65 * Whether to return the plural version of the title.
449c4e6b 66 */
7b66c3b5
AH
67 public static function getEntityTitle($plural = FALSE) {
68 return $plural ? ts('Bounce Patterns') : ts('Bounce Pattern');
449c4e6b
CW
69 }
70
e501603b 71 /**
f41f0342 72 * Returns foreign keys and entity references.
e501603b
TO
73 *
74 * @return array
75 * [CRM_Core_Reference_Interface]
76 */
c3fc2621 77 public static function getReferenceColumns() {
346aaaba 78 if (!isset(Civi::$statics[__CLASS__]['links'])) {
fa45b5b9 79 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
c3fc2621 80 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'bounce_type_id', 'civicrm_mailing_bounce_type', 'id');
346aaaba 81 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 82 }
346aaaba 83 return Civi::$statics[__CLASS__]['links'];
e501603b 84 }
c3fc2621 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 Pattern ID'),
98 'required' => TRUE,
a36434b9 99 'where' => 'civicrm_mailing_bounce_pattern.id',
522a26c9 100 'table_name' => 'civicrm_mailing_bounce_pattern',
101 'entity' => 'BouncePattern',
102 'bao' => 'CRM_Mailing_BAO_BouncePattern',
6a7e5e5d 103 'localizable' => 0,
2cbbebe8
A
104 'html' => [
105 'type' => 'Number',
106 ],
1fe423d6 107 'readonly' => TRUE,
a9d0587b 108 'add' => NULL,
c3fc2621
CW
109 ],
110 'bounce_type_id' => [
e501603b
TO
111 'name' => 'bounce_type_id',
112 'type' => CRM_Utils_Type::T_INT,
2cbbebe8 113 'title' => ts('Bounce Type ID'),
215b423e 114 'description' => ts('Type of bounce'),
c3fc2621 115 'required' => TRUE,
a36434b9 116 'where' => 'civicrm_mailing_bounce_pattern.bounce_type_id',
522a26c9 117 'table_name' => 'civicrm_mailing_bounce_pattern',
118 'entity' => 'BouncePattern',
119 'bao' => 'CRM_Mailing_BAO_BouncePattern',
6a7e5e5d 120 'localizable' => 0,
e501603b 121 'FKClassName' => 'CRM_Mailing_DAO_BounceType',
2cbbebe8
A
122 'html' => [
123 'label' => ts("Bounce Type"),
124 ],
f73a6dff
PN
125 'pseudoconstant' => [
126 'table' => 'civicrm_mailing_bounce_type',
127 'keyColumn' => 'id',
128 'labelColumn' => 'name',
129 ],
a9d0587b 130 'add' => NULL,
c3fc2621
CW
131 ],
132 'pattern' => [
e501603b
TO
133 'name' => 'pattern',
134 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 135 'title' => ts('Pattern'),
215b423e 136 'description' => ts('A regexp to match a message to a bounce type'),
e501603b
TO
137 'maxlength' => 255,
138 'size' => CRM_Utils_Type::HUGE,
a36434b9 139 'where' => 'civicrm_mailing_bounce_pattern.pattern',
522a26c9 140 'table_name' => 'civicrm_mailing_bounce_pattern',
141 'entity' => 'BouncePattern',
142 'bao' => 'CRM_Mailing_BAO_BouncePattern',
6a7e5e5d 143 'localizable' => 0,
a9d0587b 144 'add' => NULL,
c3fc2621
CW
145 ],
146 ];
346aaaba 147 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 148 }
346aaaba 149 return Civi::$statics[__CLASS__]['fields'];
e501603b 150 }
c3fc2621 151
e501603b 152 /**
bd8e0b14 153 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
154 *
155 * @return array
bd8e0b14 156 * Array(string $name => string $uniqueName).
e501603b 157 */
c3fc2621 158 public static function &fieldKeys() {
bd8e0b14
TO
159 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
160 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 161 }
bd8e0b14 162 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 163 }
c3fc2621 164
e501603b
TO
165 /**
166 * Returns the names of this table
167 *
168 * @return string
169 */
c3fc2621 170 public static function getTableName() {
e501603b
TO
171 return self::$_tableName;
172 }
c3fc2621 173
e501603b
TO
174 /**
175 * Returns if this table needs to be logged
176 *
c3fc2621 177 * @return bool
e501603b 178 */
c3fc2621 179 public function getLog() {
e501603b
TO
180 return self::$_log;
181 }
c3fc2621 182
e501603b
TO
183 /**
184 * Returns the list of fields that can be imported
185 *
186 * @param bool $prefix
187 *
188 * @return array
189 */
c3fc2621
CW
190 public static function &import($prefix = FALSE) {
191 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_bounce_pattern', $prefix, []);
60808919 192 return $r;
e501603b 193 }
c3fc2621 194
e501603b
TO
195 /**
196 * Returns the list of fields that can be exported
197 *
198 * @param bool $prefix
199 *
200 * @return array
201 */
c3fc2621
CW
202 public static function &export($prefix = FALSE) {
203 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_bounce_pattern', $prefix, []);
60808919 204 return $r;
e501603b 205 }
c3fc2621 206
e7a6b91a
AS
207 /**
208 * Returns the list of indices
c3fc2621
CW
209 *
210 * @param bool $localize
211 *
212 * @return array
e7a6b91a
AS
213 */
214 public static function indices($localize = TRUE) {
c3fc2621 215 $indices = [];
e7a6b91a
AS
216 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
217 }
c3fc2621 218
e501603b 219}