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:15aed9731c3f63c29d9d3c0c57297619)
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;
35 * @var int|string|null
36 * (SQL type: int unsigned)
37 * Note that values will be retrieved from the database as a string.
45 * (SQL type: int unsigned)
46 * Note that values will be retrieved from the database as a string.
48 public $bounce_type_id;
51 * A regexp to match a message to a bounce type
54 * (SQL type: varchar(255))
55 * Note that values will be retrieved from the database as a string.
62 public function __construct() {
63 $this->__table
= 'civicrm_mailing_bounce_pattern';
64 parent
::__construct();
68 * Returns localized title of this entity.
71 * Whether to return the plural version of the title.
73 public static function getEntityTitle($plural = FALSE) {
74 return $plural ?
ts('Bounce Patterns') : ts('Bounce Pattern');
78 * Returns foreign keys and entity references.
81 * [CRM_Core_Reference_Interface]
83 public static function getReferenceColumns() {
84 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
85 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
86 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'bounce_type_id', 'civicrm_mailing_bounce_type', 'id');
87 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
89 return Civi
::$statics[__CLASS__
]['links'];
93 * Returns all the column names of this table
97 public static function &fields() {
98 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
99 Civi
::$statics[__CLASS__
]['fields'] = [
102 'type' => CRM_Utils_Type
::T_INT
,
103 'title' => ts('Bounce Pattern ID'),
105 'where' => 'civicrm_mailing_bounce_pattern.id',
106 'table_name' => 'civicrm_mailing_bounce_pattern',
107 'entity' => 'BouncePattern',
108 'bao' => 'CRM_Mailing_BAO_BouncePattern',
116 'bounce_type_id' => [
117 'name' => 'bounce_type_id',
118 'type' => CRM_Utils_Type
::T_INT
,
119 'title' => ts('Bounce Type ID'),
120 'description' => ts('Type of bounce'),
122 'where' => 'civicrm_mailing_bounce_pattern.bounce_type_id',
123 'table_name' => 'civicrm_mailing_bounce_pattern',
124 'entity' => 'BouncePattern',
125 'bao' => 'CRM_Mailing_BAO_BouncePattern',
127 'FKClassName' => 'CRM_Mailing_DAO_BounceType',
129 'label' => ts("Bounce Type"),
131 'pseudoconstant' => [
132 'table' => 'civicrm_mailing_bounce_type',
134 'labelColumn' => 'name',
140 'type' => CRM_Utils_Type
::T_STRING
,
141 'title' => ts('Pattern'),
142 'description' => ts('A regexp to match a message to a bounce type'),
144 'size' => CRM_Utils_Type
::HUGE
,
145 'where' => 'civicrm_mailing_bounce_pattern.pattern',
146 'table_name' => 'civicrm_mailing_bounce_pattern',
147 'entity' => 'BouncePattern',
148 'bao' => 'CRM_Mailing_BAO_BouncePattern',
153 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
155 return Civi
::$statics[__CLASS__
]['fields'];
159 * Return a mapping from field-name to the corresponding key (as used in fields()).
162 * Array(string $name => string $uniqueName).
164 public static function &fieldKeys() {
165 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
166 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
168 return Civi
::$statics[__CLASS__
]['fieldKeys'];
172 * Returns the names of this table
176 public static function getTableName() {
177 return self
::$_tableName;
181 * Returns if this table needs to be logged
185 public function getLog() {
190 * Returns the list of fields that can be imported
192 * @param bool $prefix
196 public static function &import($prefix = FALSE) {
197 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_bounce_pattern', $prefix, []);
202 * Returns the list of fields that can be exported
204 * @param bool $prefix
208 public static function &export($prefix = FALSE) {
209 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_bounce_pattern', $prefix, []);
214 * Returns the list of indices
216 * @param bool $localize
220 public static function indices($localize = TRUE) {
222 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;