5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/BouncePattern.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:265a74c7d2cd07b11d0b43bf91e0fe62)
13 * Database access object for the BouncePattern entity.
15 class CRM_Mailing_DAO_BouncePattern
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_mailing_bounce_pattern';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
41 public $bounce_type_id;
44 * A regexp to match a message to a bounce type
53 public function __construct() {
54 $this->__table
= 'civicrm_mailing_bounce_pattern';
55 parent
::__construct();
59 * Returns localized title of this entity.
61 public static function getEntityTitle() {
62 return ts('Bounce Patterns');
66 * Returns foreign keys and entity references.
69 * [CRM_Core_Reference_Interface]
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']);
77 return Civi
::$statics[__CLASS__
]['links'];
81 * Returns all the column names of this table
85 public static function &fields() {
86 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
87 Civi
::$statics[__CLASS__
]['fields'] = [
90 'type' => CRM_Utils_Type
::T_INT
,
91 'title' => ts('Bounce Pattern ID'),
93 'where' => 'civicrm_mailing_bounce_pattern.id',
94 'table_name' => 'civicrm_mailing_bounce_pattern',
95 'entity' => 'BouncePattern',
96 'bao' => 'CRM_Mailing_BAO_BouncePattern',
100 'name' => 'bounce_type_id',
101 'type' => CRM_Utils_Type
::T_INT
,
102 'title' => ts('Bounce Type'),
103 'description' => ts('Type of bounce'),
105 'where' => 'civicrm_mailing_bounce_pattern.bounce_type_id',
106 'table_name' => 'civicrm_mailing_bounce_pattern',
107 'entity' => 'BouncePattern',
108 'bao' => 'CRM_Mailing_BAO_BouncePattern',
110 'FKClassName' => 'CRM_Mailing_DAO_BounceType',
111 'pseudoconstant' => [
112 'table' => 'civicrm_mailing_bounce_type',
114 'labelColumn' => 'name',
119 'type' => CRM_Utils_Type
::T_STRING
,
120 'title' => ts('Pattern'),
121 'description' => ts('A regexp to match a message to a bounce type'),
123 'size' => CRM_Utils_Type
::HUGE
,
124 'where' => 'civicrm_mailing_bounce_pattern.pattern',
125 'table_name' => 'civicrm_mailing_bounce_pattern',
126 'entity' => 'BouncePattern',
127 'bao' => 'CRM_Mailing_BAO_BouncePattern',
131 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
133 return Civi
::$statics[__CLASS__
]['fields'];
137 * Return a mapping from field-name to the corresponding key (as used in fields()).
140 * Array(string $name => string $uniqueName).
142 public static function &fieldKeys() {
143 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
144 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
146 return Civi
::$statics[__CLASS__
]['fieldKeys'];
150 * Returns the names of this table
154 public static function getTableName() {
155 return self
::$_tableName;
159 * Returns if this table needs to be logged
163 public function getLog() {
168 * Returns the list of fields that can be imported
170 * @param bool $prefix
174 public static function &import($prefix = FALSE) {
175 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_bounce_pattern', $prefix, []);
180 * Returns the list of fields that can be exported
182 * @param bool $prefix
186 public static function &export($prefix = FALSE) {
187 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_bounce_pattern', $prefix, []);
192 * Returns the list of indices
194 * @param bool $localize
198 public static function indices($localize = TRUE) {
200 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;