Merge pull request #17723 from seamuslee001/feature_contribution_detail_no_acl
[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:e36e2c40e59bfe04998b2e4e216724b6)
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 localized title of this entity.
60 */
61 public static function getEntityTitle() {
62 return ts('Bounce Patterns');
63 }
64
65 /**
66 * Returns foreign keys and entity references.
67 *
68 * @return array
69 * [CRM_Core_Reference_Interface]
70 */
71 public static function getReferenceColumns() {
72 if (!isset(Civi::$statics[__CLASS__]['links'])) {
73 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
74 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'bounce_type_id', 'civicrm_mailing_bounce_type', 'id');
75 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
76 }
77 return Civi::$statics[__CLASS__]['links'];
78 }
79
80 /**
81 * Returns all the column names of this table
82 *
83 * @return array
84 */
85 public static function &fields() {
86 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
87 Civi::$statics[__CLASS__]['fields'] = [
88 'id' => [
89 'name' => 'id',
90 'type' => CRM_Utils_Type::T_INT,
91 'title' => ts('Bounce Pattern ID'),
92 'required' => TRUE,
93 'where' => 'civicrm_mailing_bounce_pattern.id',
94 'table_name' => 'civicrm_mailing_bounce_pattern',
95 'entity' => 'BouncePattern',
96 'bao' => 'CRM_Mailing_BAO_BouncePattern',
97 'localizable' => 0,
98 'add' => NULL,
99 ],
100 'bounce_type_id' => [
101 'name' => 'bounce_type_id',
102 'type' => CRM_Utils_Type::T_INT,
103 'title' => ts('Bounce Type'),
104 'description' => ts('Type of bounce'),
105 'required' => TRUE,
106 'where' => 'civicrm_mailing_bounce_pattern.bounce_type_id',
107 'table_name' => 'civicrm_mailing_bounce_pattern',
108 'entity' => 'BouncePattern',
109 'bao' => 'CRM_Mailing_BAO_BouncePattern',
110 'localizable' => 0,
111 'FKClassName' => 'CRM_Mailing_DAO_BounceType',
112 'pseudoconstant' => [
113 'table' => 'civicrm_mailing_bounce_type',
114 'keyColumn' => 'id',
115 'labelColumn' => 'name',
116 ],
117 'add' => NULL,
118 ],
119 'pattern' => [
120 'name' => 'pattern',
121 'type' => CRM_Utils_Type::T_STRING,
122 'title' => ts('Pattern'),
123 'description' => ts('A regexp to match a message to a bounce type'),
124 'maxlength' => 255,
125 'size' => CRM_Utils_Type::HUGE,
126 'where' => 'civicrm_mailing_bounce_pattern.pattern',
127 'table_name' => 'civicrm_mailing_bounce_pattern',
128 'entity' => 'BouncePattern',
129 'bao' => 'CRM_Mailing_BAO_BouncePattern',
130 'localizable' => 0,
131 'add' => NULL,
132 ],
133 ];
134 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
135 }
136 return Civi::$statics[__CLASS__]['fields'];
137 }
138
139 /**
140 * Return a mapping from field-name to the corresponding key (as used in fields()).
141 *
142 * @return array
143 * Array(string $name => string $uniqueName).
144 */
145 public static function &fieldKeys() {
146 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
147 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
148 }
149 return Civi::$statics[__CLASS__]['fieldKeys'];
150 }
151
152 /**
153 * Returns the names of this table
154 *
155 * @return string
156 */
157 public static function getTableName() {
158 return self::$_tableName;
159 }
160
161 /**
162 * Returns if this table needs to be logged
163 *
164 * @return bool
165 */
166 public function getLog() {
167 return self::$_log;
168 }
169
170 /**
171 * Returns the list of fields that can be imported
172 *
173 * @param bool $prefix
174 *
175 * @return array
176 */
177 public static function &import($prefix = FALSE) {
178 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_bounce_pattern', $prefix, []);
179 return $r;
180 }
181
182 /**
183 * Returns the list of fields that can be exported
184 *
185 * @param bool $prefix
186 *
187 * @return array
188 */
189 public static function &export($prefix = FALSE) {
190 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_bounce_pattern', $prefix, []);
191 return $r;
192 }
193
194 /**
195 * Returns the list of indices
196 *
197 * @param bool $localize
198 *
199 * @return array
200 */
201 public static function indices($localize = TRUE) {
202 $indices = [];
203 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
204 }
205
206 }