5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/Event/Queue.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:3125dd5147f0e11ca76fae6a9377dc2e)
13 * Database access object for the Queue entity.
15 class CRM_Mailing_Event_DAO_Queue
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_event_queue';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = FALSE;
77 public function __construct() {
78 $this->__table
= 'civicrm_mailing_event_queue';
79 parent
::__construct();
83 * Returns localized title of this entity.
86 * Whether to return the plural version of the title.
88 public static function getEntityTitle($plural = FALSE) {
89 return $plural ?
ts('Queues') : ts('Queue');
93 * Returns foreign keys and entity references.
96 * [CRM_Core_Reference_Interface]
98 public static function getReferenceColumns() {
99 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
100 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
101 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'job_id', 'civicrm_mailing_job', 'id');
102 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'email_id', 'civicrm_email', 'id');
103 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
104 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'phone_id', 'civicrm_phone', 'id');
105 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
107 return Civi
::$statics[__CLASS__
]['links'];
111 * Returns all the column names of this table
115 public static function &fields() {
116 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
117 Civi
::$statics[__CLASS__
]['fields'] = [
120 'type' => CRM_Utils_Type
::T_INT
,
121 'title' => ts('Mailing Event Queue ID'),
123 'where' => 'civicrm_mailing_event_queue.id',
124 'table_name' => 'civicrm_mailing_event_queue',
126 'bao' => 'CRM_Mailing_Event_BAO_Queue',
132 'type' => CRM_Utils_Type
::T_INT
,
133 'title' => ts('Job ID'),
134 'description' => ts('FK to Job'),
136 'where' => 'civicrm_mailing_event_queue.job_id',
137 'table_name' => 'civicrm_mailing_event_queue',
139 'bao' => 'CRM_Mailing_Event_BAO_Queue',
141 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
145 'name' => 'email_id',
146 'type' => CRM_Utils_Type
::T_INT
,
147 'title' => ts('Email ID'),
148 'description' => ts('FK to Email'),
149 'where' => 'civicrm_mailing_event_queue.email_id',
151 'table_name' => 'civicrm_mailing_event_queue',
153 'bao' => 'CRM_Mailing_Event_BAO_Queue',
155 'FKClassName' => 'CRM_Core_DAO_Email',
159 'name' => 'contact_id',
160 'type' => CRM_Utils_Type
::T_INT
,
161 'title' => ts('Contact ID'),
162 'description' => ts('FK to Contact'),
164 'where' => 'civicrm_mailing_event_queue.contact_id',
165 'table_name' => 'civicrm_mailing_event_queue',
167 'bao' => 'CRM_Mailing_Event_BAO_Queue',
169 'FKClassName' => 'CRM_Contact_DAO_Contact',
174 'type' => CRM_Utils_Type
::T_STRING
,
175 'title' => ts('Security Hash'),
176 'description' => ts('Security hash'),
179 'size' => CRM_Utils_Type
::HUGE
,
180 'where' => 'civicrm_mailing_event_queue.hash',
181 'table_name' => 'civicrm_mailing_event_queue',
183 'bao' => 'CRM_Mailing_Event_BAO_Queue',
188 'name' => 'phone_id',
189 'type' => CRM_Utils_Type
::T_INT
,
190 'title' => ts('Phone ID'),
191 'description' => ts('FK to Phone'),
192 'where' => 'civicrm_mailing_event_queue.phone_id',
194 'table_name' => 'civicrm_mailing_event_queue',
196 'bao' => 'CRM_Mailing_Event_BAO_Queue',
198 'FKClassName' => 'CRM_Core_DAO_Phone',
202 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
204 return Civi
::$statics[__CLASS__
]['fields'];
208 * Return a mapping from field-name to the corresponding key (as used in fields()).
211 * Array(string $name => string $uniqueName).
213 public static function &fieldKeys() {
214 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
215 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
217 return Civi
::$statics[__CLASS__
]['fieldKeys'];
221 * Returns the names of this table
225 public static function getTableName() {
226 return self
::$_tableName;
230 * Returns if this table needs to be logged
234 public function getLog() {
239 * Returns the list of fields that can be imported
241 * @param bool $prefix
245 public static function &import($prefix = FALSE) {
246 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_queue', $prefix, []);
251 * Returns the list of fields that can be exported
253 * @param bool $prefix
257 public static function &export($prefix = FALSE) {
258 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_queue', $prefix, []);
263 * Returns the list of indices
265 * @param bool $localize
269 public static function indices($localize = TRUE) {
272 'name' => 'index_hash',
276 'localizable' => FALSE,
277 'sig' => 'civicrm_mailing_event_queue::0::hash',
280 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;