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:f37d1a6e35b4f827ed7daf29b3005fad)
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
= '';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_mailing_event_queue';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
76 public function __construct() {
77 $this->__table
= 'civicrm_mailing_event_queue';
78 parent
::__construct();
82 * Returns localized title of this entity.
85 * Whether to return the plural version of the title.
87 public static function getEntityTitle($plural = FALSE) {
88 return $plural ?
ts('Queues') : ts('Queue');
92 * Returns foreign keys and entity references.
95 * [CRM_Core_Reference_Interface]
97 public static function getReferenceColumns() {
98 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
99 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
100 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'job_id', 'civicrm_mailing_job', 'id');
101 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'email_id', 'civicrm_email', 'id');
102 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
103 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'phone_id', 'civicrm_phone', 'id');
104 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
106 return Civi
::$statics[__CLASS__
]['links'];
110 * Returns all the column names of this table
114 public static function &fields() {
115 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
116 Civi
::$statics[__CLASS__
]['fields'] = [
119 'type' => CRM_Utils_Type
::T_INT
,
120 'title' => ts('Mailing Event Queue ID'),
122 'where' => 'civicrm_mailing_event_queue.id',
123 'table_name' => 'civicrm_mailing_event_queue',
125 'bao' => 'CRM_Mailing_Event_BAO_Queue',
131 'type' => CRM_Utils_Type
::T_INT
,
132 'title' => ts('Job ID'),
133 'description' => ts('FK to Job'),
135 'where' => 'civicrm_mailing_event_queue.job_id',
136 'table_name' => 'civicrm_mailing_event_queue',
138 'bao' => 'CRM_Mailing_Event_BAO_Queue',
140 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
144 'name' => 'email_id',
145 'type' => CRM_Utils_Type
::T_INT
,
146 'title' => ts('Email ID'),
147 'description' => ts('FK to Email'),
148 'where' => 'civicrm_mailing_event_queue.email_id',
150 'table_name' => 'civicrm_mailing_event_queue',
152 'bao' => 'CRM_Mailing_Event_BAO_Queue',
154 'FKClassName' => 'CRM_Core_DAO_Email',
158 'name' => 'contact_id',
159 'type' => CRM_Utils_Type
::T_INT
,
160 'title' => ts('Contact ID'),
161 'description' => ts('FK to Contact'),
163 'where' => 'civicrm_mailing_event_queue.contact_id',
164 'table_name' => 'civicrm_mailing_event_queue',
166 'bao' => 'CRM_Mailing_Event_BAO_Queue',
168 'FKClassName' => 'CRM_Contact_DAO_Contact',
173 'type' => CRM_Utils_Type
::T_STRING
,
174 'title' => ts('Security Hash'),
175 'description' => ts('Security hash'),
178 'size' => CRM_Utils_Type
::HUGE
,
179 'where' => 'civicrm_mailing_event_queue.hash',
180 'table_name' => 'civicrm_mailing_event_queue',
182 'bao' => 'CRM_Mailing_Event_BAO_Queue',
187 'name' => 'phone_id',
188 'type' => CRM_Utils_Type
::T_INT
,
189 'title' => ts('Phone ID'),
190 'description' => ts('FK to Phone'),
191 'where' => 'civicrm_mailing_event_queue.phone_id',
193 'table_name' => 'civicrm_mailing_event_queue',
195 'bao' => 'CRM_Mailing_Event_BAO_Queue',
197 'FKClassName' => 'CRM_Core_DAO_Phone',
201 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
203 return Civi
::$statics[__CLASS__
]['fields'];
207 * Return a mapping from field-name to the corresponding key (as used in fields()).
210 * Array(string $name => string $uniqueName).
212 public static function &fieldKeys() {
213 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
214 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
216 return Civi
::$statics[__CLASS__
]['fieldKeys'];
220 * Returns the names of this table
224 public static function getTableName() {
225 return self
::$_tableName;
229 * Returns if this table needs to be logged
233 public function getLog() {
238 * Returns the list of fields that can be imported
240 * @param bool $prefix
244 public static function &import($prefix = FALSE) {
245 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_queue', $prefix, []);
250 * Returns the list of fields that can be exported
252 * @param bool $prefix
256 public static function &export($prefix = FALSE) {
257 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_queue', $prefix, []);
262 * Returns the list of indices
264 * @param bool $localize
268 public static function indices($localize = TRUE) {
271 'name' => 'index_hash',
275 'localizable' => FALSE,
276 'sig' => 'civicrm_mailing_event_queue::0::hash',
279 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;