Regenerate DAO files
[civicrm-core.git] / CRM / Mailing / Event / DAO / Queue.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2019
6 *
7 * Generated from xml/schema/CRM/Mailing/Event/Queue.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:6ce46b44932d8dcdbf39af7d91a57a03)
10 */
11
12 /**
13 * Database access object for the Queue entity.
14 */
15 class CRM_Mailing_Event_DAO_Queue extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_mailing_event_queue';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 public static $_log = FALSE;
30
31 /**
32 * @var int
33 */
34 public $id;
35
36 /**
37 * FK to Job
38 *
39 * @var int
40 */
41 public $job_id;
42
43 /**
44 * FK to Email
45 *
46 * @var int
47 */
48 public $email_id;
49
50 /**
51 * FK to Contact
52 *
53 * @var int
54 */
55 public $contact_id;
56
57 /**
58 * Security hash
59 *
60 * @var string
61 */
62 public $hash;
63
64 /**
65 * FK to Phone
66 *
67 * @var int
68 */
69 public $phone_id;
70
71 /**
72 * Class constructor.
73 */
74 public function __construct() {
75 $this->__table = 'civicrm_mailing_event_queue';
76 parent::__construct();
77 }
78
79 /**
80 * Returns foreign keys and entity references.
81 *
82 * @return array
83 * [CRM_Core_Reference_Interface]
84 */
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']);
93 }
94 return Civi::$statics[__CLASS__]['links'];
95 }
96
97 /**
98 * Returns all the column names of this table
99 *
100 * @return array
101 */
102 public static function &fields() {
103 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
104 Civi::$statics[__CLASS__]['fields'] = [
105 'id' => [
106 'name' => 'id',
107 'type' => CRM_Utils_Type::T_INT,
108 'title' => ts('Mailing Event Queue ID'),
109 'required' => TRUE,
110 'where' => 'civicrm_mailing_event_queue.id',
111 'table_name' => 'civicrm_mailing_event_queue',
112 'entity' => 'Queue',
113 'bao' => 'CRM_Mailing_Event_BAO_Queue',
114 'localizable' => 0,
115 ],
116 'job_id' => [
117 'name' => 'job_id',
118 'type' => CRM_Utils_Type::T_INT,
119 'title' => ts('Job ID'),
120 'description' => ts('FK to Job'),
121 'required' => TRUE,
122 'where' => 'civicrm_mailing_event_queue.job_id',
123 'table_name' => 'civicrm_mailing_event_queue',
124 'entity' => 'Queue',
125 'bao' => 'CRM_Mailing_Event_BAO_Queue',
126 'localizable' => 0,
127 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
128 ],
129 'email_id' => [
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',
135 'default' => 'NULL',
136 'table_name' => 'civicrm_mailing_event_queue',
137 'entity' => 'Queue',
138 'bao' => 'CRM_Mailing_Event_BAO_Queue',
139 'localizable' => 0,
140 'FKClassName' => 'CRM_Core_DAO_Email',
141 ],
142 'contact_id' => [
143 'name' => 'contact_id',
144 'type' => CRM_Utils_Type::T_INT,
145 'title' => ts('Contact ID'),
146 'description' => ts('FK to Contact'),
147 'required' => TRUE,
148 'where' => 'civicrm_mailing_event_queue.contact_id',
149 'table_name' => 'civicrm_mailing_event_queue',
150 'entity' => 'Queue',
151 'bao' => 'CRM_Mailing_Event_BAO_Queue',
152 'localizable' => 0,
153 'FKClassName' => 'CRM_Contact_DAO_Contact',
154 ],
155 'hash' => [
156 'name' => 'hash',
157 'type' => CRM_Utils_Type::T_STRING,
158 'title' => ts('Security Hash'),
159 'description' => ts('Security hash'),
160 'required' => TRUE,
161 'maxlength' => 255,
162 'size' => CRM_Utils_Type::HUGE,
163 'where' => 'civicrm_mailing_event_queue.hash',
164 'table_name' => 'civicrm_mailing_event_queue',
165 'entity' => 'Queue',
166 'bao' => 'CRM_Mailing_Event_BAO_Queue',
167 'localizable' => 0,
168 ],
169 'phone_id' => [
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',
175 'default' => 'NULL',
176 'table_name' => 'civicrm_mailing_event_queue',
177 'entity' => 'Queue',
178 'bao' => 'CRM_Mailing_Event_BAO_Queue',
179 'localizable' => 0,
180 'FKClassName' => 'CRM_Core_DAO_Phone',
181 ],
182 ];
183 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
184 }
185 return Civi::$statics[__CLASS__]['fields'];
186 }
187
188 /**
189 * Return a mapping from field-name to the corresponding key (as used in fields()).
190 *
191 * @return array
192 * Array(string $name => string $uniqueName).
193 */
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()));
197 }
198 return Civi::$statics[__CLASS__]['fieldKeys'];
199 }
200
201 /**
202 * Returns the names of this table
203 *
204 * @return string
205 */
206 public static function getTableName() {
207 return self::$_tableName;
208 }
209
210 /**
211 * Returns if this table needs to be logged
212 *
213 * @return bool
214 */
215 public function getLog() {
216 return self::$_log;
217 }
218
219 /**
220 * Returns the list of fields that can be imported
221 *
222 * @param bool $prefix
223 *
224 * @return array
225 */
226 public static function &import($prefix = FALSE) {
227 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_queue', $prefix, []);
228 return $r;
229 }
230
231 /**
232 * Returns the list of fields that can be exported
233 *
234 * @param bool $prefix
235 *
236 * @return array
237 */
238 public static function &export($prefix = FALSE) {
239 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_queue', $prefix, []);
240 return $r;
241 }
242
243 /**
244 * Returns the list of indices
245 *
246 * @param bool $localize
247 *
248 * @return array
249 */
250 public static function indices($localize = TRUE) {
251 $indices = [
252 'index_hash' => [
253 'name' => 'index_hash',
254 'field' => [
255 0 => 'hash',
256 ],
257 'localizable' => FALSE,
258 'sig' => 'civicrm_mailing_event_queue::0::hash',
259 ],
260 ];
261 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
262 }
263
264 }