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:6ce46b44932d8dcdbf39af7d91a57a03)
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 public static $_tableName = 'civicrm_mailing_event_queue';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
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 'where' => 'civicrm_mailing_event_queue.id',
111 'table_name' => 'civicrm_mailing_event_queue',
113 'bao' => 'CRM_Mailing_Event_BAO_Queue',
118 'type' => CRM_Utils_Type
::T_INT
,
119 'title' => ts('Job ID'),
120 'description' => ts('FK to Job'),
122 'where' => 'civicrm_mailing_event_queue.job_id',
123 'table_name' => 'civicrm_mailing_event_queue',
125 'bao' => 'CRM_Mailing_Event_BAO_Queue',
127 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
130 'name' => 'email_id',
131 'type' => CRM_Utils_Type
::T_INT
,
132 'title' => ts('Email ID'),
133 'description' => ts('FK to Email'),
134 'where' => 'civicrm_mailing_event_queue.email_id',
136 'table_name' => 'civicrm_mailing_event_queue',
138 'bao' => 'CRM_Mailing_Event_BAO_Queue',
140 'FKClassName' => 'CRM_Core_DAO_Email',
143 'name' => 'contact_id',
144 'type' => CRM_Utils_Type
::T_INT
,
145 'title' => ts('Contact ID'),
146 'description' => ts('FK to Contact'),
148 'where' => 'civicrm_mailing_event_queue.contact_id',
149 'table_name' => 'civicrm_mailing_event_queue',
151 'bao' => 'CRM_Mailing_Event_BAO_Queue',
153 'FKClassName' => 'CRM_Contact_DAO_Contact',
157 'type' => CRM_Utils_Type
::T_STRING
,
158 'title' => ts('Security Hash'),
159 'description' => ts('Security hash'),
162 'size' => CRM_Utils_Type
::HUGE
,
163 'where' => 'civicrm_mailing_event_queue.hash',
164 'table_name' => 'civicrm_mailing_event_queue',
166 'bao' => 'CRM_Mailing_Event_BAO_Queue',
170 'name' => 'phone_id',
171 'type' => CRM_Utils_Type
::T_INT
,
172 'title' => ts('Phone ID'),
173 'description' => ts('FK to Phone'),
174 'where' => 'civicrm_mailing_event_queue.phone_id',
176 'table_name' => 'civicrm_mailing_event_queue',
178 'bao' => 'CRM_Mailing_Event_BAO_Queue',
180 'FKClassName' => 'CRM_Core_DAO_Phone',
183 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
185 return Civi
::$statics[__CLASS__
]['fields'];
189 * Return a mapping from field-name to the corresponding key (as used in fields()).
192 * Array(string $name => string $uniqueName).
194 public static function &fieldKeys() {
195 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
196 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
198 return Civi
::$statics[__CLASS__
]['fieldKeys'];
202 * Returns the names of this table
206 public static function getTableName() {
207 return self
::$_tableName;
211 * Returns if this table needs to be logged
215 public function getLog() {
220 * Returns the list of fields that can be imported
222 * @param bool $prefix
226 public static function &import($prefix = FALSE) {
227 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_queue', $prefix, []);
232 * Returns the list of fields that can be exported
234 * @param bool $prefix
238 public static function &export($prefix = FALSE) {
239 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_queue', $prefix, []);
244 * Returns the list of indices
246 * @param bool $localize
250 public static function indices($localize = TRUE) {
253 'name' => 'index_hash',
257 'localizable' => FALSE,
258 'sig' => 'civicrm_mailing_event_queue::0::hash',
261 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;