Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
ca5cec67 | 5 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Mailing/Event/Queue.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
d31fb4e3 | 9 | * (GenCodeChecksum:3125dd5147f0e11ca76fae6a9377dc2e) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the Queue entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Mailing_Event_DAO_Queue extends CRM_Core_DAO { |
929a1c14 CW |
16 | const EXT = 'civicrm'; |
17 | const TABLE_ADDED = ''; | |
d31fb4e3 | 18 | const COMPONENT = 'CiviMail'; |
c3fc2621 | 19 | |
e501603b | 20 | /** |
f41f0342 | 21 | * Static instance to hold the table name. |
e501603b TO |
22 | * |
23 | * @var string | |
24 | */ | |
fa45b5b9 | 25 | public static $_tableName = 'civicrm_mailing_event_queue'; |
c3fc2621 | 26 | |
e501603b | 27 | /** |
f41f0342 | 28 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 29 | * |
c3fc2621 | 30 | * @var bool |
e501603b | 31 | */ |
fa45b5b9 | 32 | public static $_log = FALSE; |
c3fc2621 | 33 | |
e501603b | 34 | /** |
e6ca0a57 | 35 | * @var int |
e501603b TO |
36 | */ |
37 | public $id; | |
c3fc2621 | 38 | |
e501603b TO |
39 | /** |
40 | * FK to Job | |
41 | * | |
e6ca0a57 | 42 | * @var int |
e501603b TO |
43 | */ |
44 | public $job_id; | |
c3fc2621 | 45 | |
e501603b TO |
46 | /** |
47 | * FK to Email | |
48 | * | |
e6ca0a57 | 49 | * @var int |
e501603b TO |
50 | */ |
51 | public $email_id; | |
c3fc2621 | 52 | |
e501603b TO |
53 | /** |
54 | * FK to Contact | |
55 | * | |
e6ca0a57 | 56 | * @var int |
e501603b TO |
57 | */ |
58 | public $contact_id; | |
c3fc2621 | 59 | |
e501603b TO |
60 | /** |
61 | * Security hash | |
62 | * | |
63 | * @var string | |
64 | */ | |
65 | public $hash; | |
c3fc2621 | 66 | |
e501603b TO |
67 | /** |
68 | * FK to Phone | |
69 | * | |
e6ca0a57 | 70 | * @var int |
e501603b TO |
71 | */ |
72 | public $phone_id; | |
c3fc2621 | 73 | |
e501603b | 74 | /** |
f41f0342 | 75 | * Class constructor. |
e501603b | 76 | */ |
c3fc2621 | 77 | public function __construct() { |
e501603b TO |
78 | $this->__table = 'civicrm_mailing_event_queue'; |
79 | parent::__construct(); | |
80 | } | |
c3fc2621 | 81 | |
449c4e6b CW |
82 | /** |
83 | * Returns localized title of this entity. | |
7b66c3b5 AH |
84 | * |
85 | * @param bool $plural | |
86 | * Whether to return the plural version of the title. | |
449c4e6b | 87 | */ |
7b66c3b5 AH |
88 | public static function getEntityTitle($plural = FALSE) { |
89 | return $plural ? ts('Queues') : ts('Queue'); | |
449c4e6b CW |
90 | } |
91 | ||
e501603b | 92 | /** |
f41f0342 | 93 | * Returns foreign keys and entity references. |
e501603b TO |
94 | * |
95 | * @return array | |
96 | * [CRM_Core_Reference_Interface] | |
97 | */ | |
c3fc2621 | 98 | public static function getReferenceColumns() { |
346aaaba | 99 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
a36434b9 | 100 | Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); |
c3fc2621 CW |
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'); | |
346aaaba | 105 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 106 | } |
346aaaba | 107 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 108 | } |
c3fc2621 | 109 | |
e501603b TO |
110 | /** |
111 | * Returns all the column names of this table | |
112 | * | |
113 | * @return array | |
114 | */ | |
c3fc2621 | 115 | public static function &fields() { |
346aaaba | 116 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
117 | Civi::$statics[__CLASS__]['fields'] = [ |
118 | 'id' => [ | |
e501603b TO |
119 | 'name' => 'id', |
120 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 CW |
121 | 'title' => ts('Mailing Event Queue ID'), |
122 | 'required' => TRUE, | |
a36434b9 | 123 | 'where' => 'civicrm_mailing_event_queue.id', |
522a26c9 | 124 | 'table_name' => 'civicrm_mailing_event_queue', |
125 | 'entity' => 'Queue', | |
126 | 'bao' => 'CRM_Mailing_Event_BAO_Queue', | |
6a7e5e5d | 127 | 'localizable' => 0, |
a9d0587b | 128 | 'add' => NULL, |
c3fc2621 CW |
129 | ], |
130 | 'job_id' => [ | |
e501603b TO |
131 | 'name' => 'job_id', |
132 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 133 | 'title' => ts('Job ID'), |
215b423e | 134 | 'description' => ts('FK to Job'), |
c3fc2621 | 135 | 'required' => TRUE, |
a36434b9 | 136 | 'where' => 'civicrm_mailing_event_queue.job_id', |
522a26c9 | 137 | 'table_name' => 'civicrm_mailing_event_queue', |
138 | 'entity' => 'Queue', | |
139 | 'bao' => 'CRM_Mailing_Event_BAO_Queue', | |
6a7e5e5d | 140 | 'localizable' => 0, |
e501603b | 141 | 'FKClassName' => 'CRM_Mailing_DAO_MailingJob', |
a9d0587b | 142 | 'add' => NULL, |
c3fc2621 CW |
143 | ], |
144 | 'email_id' => [ | |
e501603b TO |
145 | 'name' => 'email_id', |
146 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 147 | 'title' => ts('Email ID'), |
215b423e | 148 | 'description' => ts('FK to Email'), |
a36434b9 | 149 | 'where' => 'civicrm_mailing_event_queue.email_id', |
e501603b | 150 | 'default' => 'NULL', |
522a26c9 | 151 | 'table_name' => 'civicrm_mailing_event_queue', |
152 | 'entity' => 'Queue', | |
153 | 'bao' => 'CRM_Mailing_Event_BAO_Queue', | |
6a7e5e5d | 154 | 'localizable' => 0, |
e501603b | 155 | 'FKClassName' => 'CRM_Core_DAO_Email', |
a9d0587b | 156 | 'add' => NULL, |
c3fc2621 CW |
157 | ], |
158 | 'contact_id' => [ | |
e501603b TO |
159 | 'name' => 'contact_id', |
160 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 161 | 'title' => ts('Contact ID'), |
215b423e | 162 | 'description' => ts('FK to Contact'), |
c3fc2621 | 163 | 'required' => TRUE, |
a36434b9 | 164 | 'where' => 'civicrm_mailing_event_queue.contact_id', |
522a26c9 | 165 | 'table_name' => 'civicrm_mailing_event_queue', |
166 | 'entity' => 'Queue', | |
167 | 'bao' => 'CRM_Mailing_Event_BAO_Queue', | |
6a7e5e5d | 168 | 'localizable' => 0, |
e501603b | 169 | 'FKClassName' => 'CRM_Contact_DAO_Contact', |
a9d0587b | 170 | 'add' => NULL, |
c3fc2621 CW |
171 | ], |
172 | 'hash' => [ | |
e501603b TO |
173 | 'name' => 'hash', |
174 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 175 | 'title' => ts('Security Hash'), |
215b423e | 176 | 'description' => ts('Security hash'), |
c3fc2621 | 177 | 'required' => TRUE, |
e501603b TO |
178 | 'maxlength' => 255, |
179 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 180 | 'where' => 'civicrm_mailing_event_queue.hash', |
522a26c9 | 181 | 'table_name' => 'civicrm_mailing_event_queue', |
182 | 'entity' => 'Queue', | |
183 | 'bao' => 'CRM_Mailing_Event_BAO_Queue', | |
6a7e5e5d | 184 | 'localizable' => 0, |
a9d0587b | 185 | 'add' => NULL, |
c3fc2621 CW |
186 | ], |
187 | 'phone_id' => [ | |
e501603b TO |
188 | 'name' => 'phone_id', |
189 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 190 | 'title' => ts('Phone ID'), |
215b423e | 191 | 'description' => ts('FK to Phone'), |
a36434b9 | 192 | 'where' => 'civicrm_mailing_event_queue.phone_id', |
e501603b | 193 | 'default' => 'NULL', |
522a26c9 | 194 | 'table_name' => 'civicrm_mailing_event_queue', |
195 | 'entity' => 'Queue', | |
196 | 'bao' => 'CRM_Mailing_Event_BAO_Queue', | |
6a7e5e5d | 197 | 'localizable' => 0, |
e501603b | 198 | 'FKClassName' => 'CRM_Core_DAO_Phone', |
a9d0587b | 199 | 'add' => NULL, |
c3fc2621 CW |
200 | ], |
201 | ]; | |
346aaaba | 202 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 203 | } |
346aaaba | 204 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 205 | } |
c3fc2621 | 206 | |
e501603b | 207 | /** |
bd8e0b14 | 208 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
209 | * |
210 | * @return array | |
bd8e0b14 | 211 | * Array(string $name => string $uniqueName). |
e501603b | 212 | */ |
c3fc2621 | 213 | public static function &fieldKeys() { |
bd8e0b14 TO |
214 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
215 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 216 | } |
bd8e0b14 | 217 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 218 | } |
c3fc2621 | 219 | |
e501603b TO |
220 | /** |
221 | * Returns the names of this table | |
222 | * | |
223 | * @return string | |
224 | */ | |
c3fc2621 | 225 | public static function getTableName() { |
e501603b TO |
226 | return self::$_tableName; |
227 | } | |
c3fc2621 | 228 | |
e501603b TO |
229 | /** |
230 | * Returns if this table needs to be logged | |
231 | * | |
c3fc2621 | 232 | * @return bool |
e501603b | 233 | */ |
c3fc2621 | 234 | public function getLog() { |
e501603b TO |
235 | return self::$_log; |
236 | } | |
c3fc2621 | 237 | |
e501603b TO |
238 | /** |
239 | * Returns the list of fields that can be imported | |
240 | * | |
241 | * @param bool $prefix | |
242 | * | |
243 | * @return array | |
244 | */ | |
c3fc2621 CW |
245 | public static function &import($prefix = FALSE) { |
246 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_queue', $prefix, []); | |
60808919 | 247 | return $r; |
e501603b | 248 | } |
c3fc2621 | 249 | |
e501603b TO |
250 | /** |
251 | * Returns the list of fields that can be exported | |
252 | * | |
253 | * @param bool $prefix | |
254 | * | |
255 | * @return array | |
256 | */ | |
c3fc2621 CW |
257 | public static function &export($prefix = FALSE) { |
258 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_queue', $prefix, []); | |
60808919 | 259 | return $r; |
e501603b | 260 | } |
c3fc2621 | 261 | |
e7a6b91a AS |
262 | /** |
263 | * Returns the list of indices | |
c3fc2621 CW |
264 | * |
265 | * @param bool $localize | |
266 | * | |
267 | * @return array | |
e7a6b91a AS |
268 | */ |
269 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
270 | $indices = [ |
271 | 'index_hash' => [ | |
ab49600a | 272 | 'name' => 'index_hash', |
c3fc2621 | 273 | 'field' => [ |
ab49600a | 274 | 0 => 'hash', |
c3fc2621 CW |
275 | ], |
276 | 'localizable' => FALSE, | |
ab49600a | 277 | 'sig' => 'civicrm_mailing_event_queue::0::hash', |
c3fc2621 CW |
278 | ], |
279 | ]; | |
e7a6b91a AS |
280 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
281 | } | |
c3fc2621 | 282 | |
e501603b | 283 | } |