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:65ffd17da4de88b093e578fc52d42800)
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
= '';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_mailing_bounce_pattern';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
43 public $bounce_type_id;
46 * A regexp to match a message to a bounce type
55 public function __construct() {
56 $this->__table
= 'civicrm_mailing_bounce_pattern';
57 parent
::__construct();
61 * Returns localized title of this entity.
64 * Whether to return the plural version of the title.
66 public static function getEntityTitle($plural = FALSE) {
67 return $plural ?
ts('Bounce Patterns') : ts('Bounce Pattern');
71 * Returns foreign keys and entity references.
74 * [CRM_Core_Reference_Interface]
76 public static function getReferenceColumns() {
77 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
78 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
79 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'bounce_type_id', 'civicrm_mailing_bounce_type', 'id');
80 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
82 return Civi
::$statics[__CLASS__
]['links'];
86 * Returns all the column names of this table
90 public static function &fields() {
91 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
92 Civi
::$statics[__CLASS__
]['fields'] = [
95 'type' => CRM_Utils_Type
::T_INT
,
96 'title' => ts('Bounce Pattern ID'),
98 'where' => 'civicrm_mailing_bounce_pattern.id',
99 'table_name' => 'civicrm_mailing_bounce_pattern',
100 'entity' => 'BouncePattern',
101 'bao' => 'CRM_Mailing_BAO_BouncePattern',
105 'bounce_type_id' => [
106 'name' => 'bounce_type_id',
107 'type' => CRM_Utils_Type
::T_INT
,
108 'title' => ts('Bounce Type'),
109 'description' => ts('Type of bounce'),
111 'where' => 'civicrm_mailing_bounce_pattern.bounce_type_id',
112 'table_name' => 'civicrm_mailing_bounce_pattern',
113 'entity' => 'BouncePattern',
114 'bao' => 'CRM_Mailing_BAO_BouncePattern',
116 'FKClassName' => 'CRM_Mailing_DAO_BounceType',
117 'pseudoconstant' => [
118 'table' => 'civicrm_mailing_bounce_type',
120 'labelColumn' => 'name',
126 'type' => CRM_Utils_Type
::T_STRING
,
127 'title' => ts('Pattern'),
128 'description' => ts('A regexp to match a message to a bounce type'),
130 'size' => CRM_Utils_Type
::HUGE
,
131 'where' => 'civicrm_mailing_bounce_pattern.pattern',
132 'table_name' => 'civicrm_mailing_bounce_pattern',
133 'entity' => 'BouncePattern',
134 'bao' => 'CRM_Mailing_BAO_BouncePattern',
139 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
141 return Civi
::$statics[__CLASS__
]['fields'];
145 * Return a mapping from field-name to the corresponding key (as used in fields()).
148 * Array(string $name => string $uniqueName).
150 public static function &fieldKeys() {
151 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
152 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
154 return Civi
::$statics[__CLASS__
]['fieldKeys'];
158 * Returns the names of this table
162 public static function getTableName() {
163 return self
::$_tableName;
167 * Returns if this table needs to be logged
171 public function getLog() {
176 * Returns the list of fields that can be imported
178 * @param bool $prefix
182 public static function &import($prefix = FALSE) {
183 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_bounce_pattern', $prefix, []);
188 * Returns the list of fields that can be exported
190 * @param bool $prefix
194 public static function &export($prefix = FALSE) {
195 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_bounce_pattern', $prefix, []);
200 * Returns the list of indices
202 * @param bool $localize
206 public static function indices($localize = TRUE) {
208 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;