5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Mailing/BouncePattern.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:4c704cc977e01082612050ebc367ce1a)
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 static $_tableName = 'civicrm_mailing_bounce_pattern';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 foreign keys and entity references.
62 * [CRM_Core_Reference_Interface]
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']);
70 return Civi
::$statics[__CLASS__
]['links'];
74 * Returns all the column names of this table
78 public static function &fields() {
79 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
80 Civi
::$statics[__CLASS__
]['fields'] = [
83 'type' => CRM_Utils_Type
::T_INT
,
84 'title' => ts('Bounce Pattern ID'),
86 'table_name' => 'civicrm_mailing_bounce_pattern',
87 'entity' => 'BouncePattern',
88 'bao' => 'CRM_Mailing_BAO_BouncePattern',
92 'name' => 'bounce_type_id',
93 'type' => CRM_Utils_Type
::T_INT
,
94 'title' => ts('Bounce Type'),
95 'description' => ts('Type of bounce'),
97 'table_name' => 'civicrm_mailing_bounce_pattern',
98 'entity' => 'BouncePattern',
99 'bao' => 'CRM_Mailing_BAO_BouncePattern',
101 'FKClassName' => 'CRM_Mailing_DAO_BounceType',
105 'type' => CRM_Utils_Type
::T_STRING
,
106 'title' => ts('Pattern'),
107 'description' => ts('A regexp to match a message to a bounce type'),
109 'size' => CRM_Utils_Type
::HUGE
,
110 'table_name' => 'civicrm_mailing_bounce_pattern',
111 'entity' => 'BouncePattern',
112 'bao' => 'CRM_Mailing_BAO_BouncePattern',
116 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
118 return Civi
::$statics[__CLASS__
]['fields'];
122 * Return a mapping from field-name to the corresponding key (as used in fields()).
125 * Array(string $name => string $uniqueName).
127 public static function &fieldKeys() {
128 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
129 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
131 return Civi
::$statics[__CLASS__
]['fieldKeys'];
135 * Returns the names of this table
139 public static function getTableName() {
140 return self
::$_tableName;
144 * Returns if this table needs to be logged
148 public function getLog() {
153 * Returns the list of fields that can be imported
155 * @param bool $prefix
159 public static function &import($prefix = FALSE) {
160 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_bounce_pattern', $prefix, []);
165 * Returns the list of fields that can be exported
167 * @param bool $prefix
171 public static function &export($prefix = FALSE) {
172 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_bounce_pattern', $prefix, []);
177 * Returns the list of indices
179 * @param bool $localize
183 public static function indices($localize = TRUE) {
185 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;