Merge pull request #16584 from eileenmcnaughton/role
[civicrm-core.git] / CRM / Mailing / DAO / BouncePattern.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Mailing/BouncePattern.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:c72ed4774d00758d25e6a167f4215906)
10 */
11
12 /**
13 * Database access object for the BouncePattern entity.
14 */
15 class CRM_Mailing_DAO_BouncePattern extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_mailing_bounce_pattern';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 public static $_log = FALSE;
30
31 /**
32 * @var int
33 */
34 public $id;
35
36 /**
37 * Type of bounce
38 *
39 * @var int
40 */
41 public $bounce_type_id;
42
43 /**
44 * A regexp to match a message to a bounce type
45 *
46 * @var string
47 */
48 public $pattern;
49
50 /**
51 * Class constructor.
52 */
53 public function __construct() {
54 $this->__table = 'civicrm_mailing_bounce_pattern';
55 parent::__construct();
56 }
57
58 /**
59 * Returns foreign keys and entity references.
60 *
61 * @return array
62 * [CRM_Core_Reference_Interface]
63 */
64 public static function getReferenceColumns() {
65 if (!isset(Civi::$statics[__CLASS__]['links'])) {
66 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
67 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'bounce_type_id', 'civicrm_mailing_bounce_type', 'id');
68 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
69 }
70 return Civi::$statics[__CLASS__]['links'];
71 }
72
73 /**
74 * Returns all the column names of this table
75 *
76 * @return array
77 */
78 public static function &fields() {
79 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
80 Civi::$statics[__CLASS__]['fields'] = [
81 'id' => [
82 'name' => 'id',
83 'type' => CRM_Utils_Type::T_INT,
84 'title' => ts('Bounce Pattern ID'),
85 'required' => TRUE,
86 'where' => 'civicrm_mailing_bounce_pattern.id',
87 'table_name' => 'civicrm_mailing_bounce_pattern',
88 'entity' => 'BouncePattern',
89 'bao' => 'CRM_Mailing_BAO_BouncePattern',
90 'localizable' => 0,
91 ],
92 'bounce_type_id' => [
93 'name' => 'bounce_type_id',
94 'type' => CRM_Utils_Type::T_INT,
95 'title' => ts('Bounce Type'),
96 'description' => ts('Type of bounce'),
97 'required' => TRUE,
98 'where' => 'civicrm_mailing_bounce_pattern.bounce_type_id',
99 'table_name' => 'civicrm_mailing_bounce_pattern',
100 'entity' => 'BouncePattern',
101 'bao' => 'CRM_Mailing_BAO_BouncePattern',
102 'localizable' => 0,
103 'FKClassName' => 'CRM_Mailing_DAO_BounceType',
104 'pseudoconstant' => [
105 'table' => 'civicrm_mailing_bounce_type',
106 'keyColumn' => 'id',
107 'labelColumn' => 'name',
108 ],
109 ],
110 'pattern' => [
111 'name' => 'pattern',
112 'type' => CRM_Utils_Type::T_STRING,
113 'title' => ts('Pattern'),
114 'description' => ts('A regexp to match a message to a bounce type'),
115 'maxlength' => 255,
116 'size' => CRM_Utils_Type::HUGE,
117 'where' => 'civicrm_mailing_bounce_pattern.pattern',
118 'table_name' => 'civicrm_mailing_bounce_pattern',
119 'entity' => 'BouncePattern',
120 'bao' => 'CRM_Mailing_BAO_BouncePattern',
121 'localizable' => 0,
122 ],
123 ];
124 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
125 }
126 return Civi::$statics[__CLASS__]['fields'];
127 }
128
129 /**
130 * Return a mapping from field-name to the corresponding key (as used in fields()).
131 *
132 * @return array
133 * Array(string $name => string $uniqueName).
134 */
135 public static function &fieldKeys() {
136 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
137 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
138 }
139 return Civi::$statics[__CLASS__]['fieldKeys'];
140 }
141
142 /**
143 * Returns the names of this table
144 *
145 * @return string
146 */
147 public static function getTableName() {
148 return self::$_tableName;
149 }
150
151 /**
152 * Returns if this table needs to be logged
153 *
154 * @return bool
155 */
156 public function getLog() {
157 return self::$_log;
158 }
159
160 /**
161 * Returns the list of fields that can be imported
162 *
163 * @param bool $prefix
164 *
165 * @return array
166 */
167 public static function &import($prefix = FALSE) {
168 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_bounce_pattern', $prefix, []);
169 return $r;
170 }
171
172 /**
173 * Returns the list of fields that can be exported
174 *
175 * @param bool $prefix
176 *
177 * @return array
178 */
179 public static function &export($prefix = FALSE) {
180 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_bounce_pattern', $prefix, []);
181 return $r;
182 }
183
184 /**
185 * Returns the list of indices
186 *
187 * @param bool $localize
188 *
189 * @return array
190 */
191 public static function indices($localize = TRUE) {
192 $indices = [];
193 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
194 }
195
196 }