5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/BounceType.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:ef69aba971b0a118a9ec2238a180c7c5)
13 * Database access object for the BounceType entity.
15 class CRM_Mailing_DAO_BounceType
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_type';
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: varchar(24))
46 * Note that values will be retrieved from the database as a string.
51 * A description of this bounce type
54 * (SQL type: varchar(255))
55 * Note that values will be retrieved from the database as a string.
60 * Number of bounces of this type required before the email address is put on bounce hold
63 * (SQL type: int unsigned)
64 * Note that values will be retrieved from the database as a string.
66 public $hold_threshold;
71 public function __construct() {
72 $this->__table
= 'civicrm_mailing_bounce_type';
73 parent
::__construct();
77 * Returns localized title of this entity.
80 * Whether to return the plural version of the title.
82 public static function getEntityTitle($plural = FALSE) {
83 return $plural ?
ts('Bounce Types') : ts('Bounce Type');
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 Type ID'),
99 'where' => 'civicrm_mailing_bounce_type.id',
100 'table_name' => 'civicrm_mailing_bounce_type',
101 'entity' => 'BounceType',
102 'bao' => 'CRM_Mailing_DAO_BounceType',
112 'type' => CRM_Utils_Type
::T_STRING
,
113 'title' => ts('Bounce Type Name'),
114 'description' => ts('Type of bounce'),
117 'size' => CRM_Utils_Type
::MEDIUM
,
118 'where' => 'civicrm_mailing_bounce_type.name',
119 'table_name' => 'civicrm_mailing_bounce_type',
120 'entity' => 'BounceType',
121 'bao' => 'CRM_Mailing_DAO_BounceType',
126 'name' => 'description',
127 'type' => CRM_Utils_Type
::T_STRING
,
128 'title' => ts('Bounce Type Description'),
129 'description' => ts('A description of this bounce type'),
131 'size' => CRM_Utils_Type
::HUGE
,
132 'where' => 'civicrm_mailing_bounce_type.description',
133 'table_name' => 'civicrm_mailing_bounce_type',
134 'entity' => 'BounceType',
135 'bao' => 'CRM_Mailing_DAO_BounceType',
139 'hold_threshold' => [
140 'name' => 'hold_threshold',
141 'type' => CRM_Utils_Type
::T_INT
,
142 'title' => ts('Hold Threshold'),
143 'description' => ts('Number of bounces of this type required before the email address is put on bounce hold'),
145 'where' => 'civicrm_mailing_bounce_type.hold_threshold',
146 'table_name' => 'civicrm_mailing_bounce_type',
147 'entity' => 'BounceType',
148 'bao' => 'CRM_Mailing_DAO_BounceType',
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_type', $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_type', $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;