5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Mailing/Event/Queue.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:2b873b4e3dae5279b8b63b6e4de5adc0)
13 * Database access object for the Queue entity.
15 class CRM_Mailing_Event_DAO_Queue
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 static $_tableName = 'civicrm_mailing_event_queue';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
74 public function __construct() {
75 $this->__table
= 'civicrm_mailing_event_queue';
76 parent
::__construct();
80 * Returns foreign keys and entity references.
83 * [CRM_Core_Reference_Interface]
85 public static function getReferenceColumns() {
86 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
87 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
88 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'job_id', 'civicrm_mailing_job', 'id');
89 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'email_id', 'civicrm_email', 'id');
90 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
91 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'phone_id', 'civicrm_phone', 'id');
92 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
94 return Civi
::$statics[__CLASS__
]['links'];
98 * Returns all the column names of this table
102 public static function &fields() {
103 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
104 Civi
::$statics[__CLASS__
]['fields'] = [
107 'type' => CRM_Utils_Type
::T_INT
,
108 'title' => ts('Mailing Event Queue ID'),
110 'table_name' => 'civicrm_mailing_event_queue',
112 'bao' => 'CRM_Mailing_Event_BAO_Queue',
117 'type' => CRM_Utils_Type
::T_INT
,
118 'title' => ts('Job ID'),
119 'description' => ts('FK to Job'),
121 'table_name' => 'civicrm_mailing_event_queue',
123 'bao' => 'CRM_Mailing_Event_BAO_Queue',
125 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
128 'name' => 'email_id',
129 'type' => CRM_Utils_Type
::T_INT
,
130 'title' => ts('Email ID'),
131 'description' => ts('FK to Email'),
133 'table_name' => 'civicrm_mailing_event_queue',
135 'bao' => 'CRM_Mailing_Event_BAO_Queue',
137 'FKClassName' => 'CRM_Core_DAO_Email',
140 'name' => 'contact_id',
141 'type' => CRM_Utils_Type
::T_INT
,
142 'title' => ts('Contact ID'),
143 'description' => ts('FK to Contact'),
145 'table_name' => 'civicrm_mailing_event_queue',
147 'bao' => 'CRM_Mailing_Event_BAO_Queue',
149 'FKClassName' => 'CRM_Contact_DAO_Contact',
153 'type' => CRM_Utils_Type
::T_STRING
,
154 'title' => ts('Security Hash'),
155 'description' => ts('Security hash'),
158 'size' => CRM_Utils_Type
::HUGE
,
159 'table_name' => 'civicrm_mailing_event_queue',
161 'bao' => 'CRM_Mailing_Event_BAO_Queue',
165 'name' => 'phone_id',
166 'type' => CRM_Utils_Type
::T_INT
,
167 'title' => ts('Phone ID'),
168 'description' => ts('FK to Phone'),
170 'table_name' => 'civicrm_mailing_event_queue',
172 'bao' => 'CRM_Mailing_Event_BAO_Queue',
174 'FKClassName' => 'CRM_Core_DAO_Phone',
177 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
179 return Civi
::$statics[__CLASS__
]['fields'];
183 * Return a mapping from field-name to the corresponding key (as used in fields()).
186 * Array(string $name => string $uniqueName).
188 public static function &fieldKeys() {
189 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
190 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
192 return Civi
::$statics[__CLASS__
]['fieldKeys'];
196 * Returns the names of this table
200 public static function getTableName() {
201 return self
::$_tableName;
205 * Returns if this table needs to be logged
209 public function getLog() {
214 * Returns the list of fields that can be imported
216 * @param bool $prefix
220 public static function &import($prefix = FALSE) {
221 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_queue', $prefix, []);
226 * Returns the list of fields that can be exported
228 * @param bool $prefix
232 public static function &export($prefix = FALSE) {
233 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_queue', $prefix, []);
238 * Returns the list of indices
240 * @param bool $localize
244 public static function indices($localize = TRUE) {
247 'name' => 'index_hash',
251 'localizable' => FALSE,
252 'sig' => 'civicrm_mailing_event_queue::0::hash',
255 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;