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:c69a86cc75621a05e32951247e12f06b)
13 * Database access object for the BouncePattern entity.
15 class CRM_Mailing_DAO_BouncePattern
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '';
18 const COMPONENT
= 'CiviMail';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_mailing_bounce_pattern';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = FALSE;
44 public $bounce_type_id;
47 * A regexp to match a message to a bounce type
56 public function __construct() {
57 $this->__table
= 'civicrm_mailing_bounce_pattern';
58 parent
::__construct();
62 * Returns localized title of this entity.
65 * Whether to return the plural version of the title.
67 public static function getEntityTitle($plural = FALSE) {
68 return $plural ?
ts('Bounce Patterns') : ts('Bounce Pattern');
72 * Returns foreign keys and entity references.
75 * [CRM_Core_Reference_Interface]
77 public static function getReferenceColumns() {
78 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
79 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
80 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'bounce_type_id', 'civicrm_mailing_bounce_type', 'id');
81 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
83 return Civi
::$statics[__CLASS__
]['links'];
87 * Returns all the column names of this table
91 public static function &fields() {
92 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
93 Civi
::$statics[__CLASS__
]['fields'] = [
96 'type' => CRM_Utils_Type
::T_INT
,
97 'title' => ts('Bounce Pattern ID'),
99 'where' => 'civicrm_mailing_bounce_pattern.id',
100 'table_name' => 'civicrm_mailing_bounce_pattern',
101 'entity' => 'BouncePattern',
102 'bao' => 'CRM_Mailing_BAO_BouncePattern',
110 'bounce_type_id' => [
111 'name' => 'bounce_type_id',
112 'type' => CRM_Utils_Type
::T_INT
,
113 'title' => ts('Bounce Type ID'),
114 'description' => ts('Type of bounce'),
116 'where' => 'civicrm_mailing_bounce_pattern.bounce_type_id',
117 'table_name' => 'civicrm_mailing_bounce_pattern',
118 'entity' => 'BouncePattern',
119 'bao' => 'CRM_Mailing_BAO_BouncePattern',
121 'FKClassName' => 'CRM_Mailing_DAO_BounceType',
123 'label' => ts("Bounce Type"),
125 'pseudoconstant' => [
126 'table' => 'civicrm_mailing_bounce_type',
128 'labelColumn' => 'name',
134 'type' => CRM_Utils_Type
::T_STRING
,
135 'title' => ts('Pattern'),
136 'description' => ts('A regexp to match a message to a bounce type'),
138 'size' => CRM_Utils_Type
::HUGE
,
139 'where' => 'civicrm_mailing_bounce_pattern.pattern',
140 'table_name' => 'civicrm_mailing_bounce_pattern',
141 'entity' => 'BouncePattern',
142 'bao' => 'CRM_Mailing_BAO_BouncePattern',
147 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
149 return Civi
::$statics[__CLASS__
]['fields'];
153 * Return a mapping from field-name to the corresponding key (as used in fields()).
156 * Array(string $name => string $uniqueName).
158 public static function &fieldKeys() {
159 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
160 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
162 return Civi
::$statics[__CLASS__
]['fieldKeys'];
166 * Returns the names of this table
170 public static function getTableName() {
171 return self
::$_tableName;
175 * Returns if this table needs to be logged
179 public function getLog() {
184 * Returns the list of fields that can be imported
186 * @param bool $prefix
190 public static function &import($prefix = FALSE) {
191 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_bounce_pattern', $prefix, []);
196 * Returns the list of fields that can be exported
198 * @param bool $prefix
202 public static function &export($prefix = FALSE) {
203 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_bounce_pattern', $prefix, []);
208 * Returns the list of indices
210 * @param bool $localize
214 public static function indices($localize = TRUE) {
216 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;