(NFC) Set _log and _table_name variables to be public
[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:2b873b4e3dae5279b8b63b6e4de5adc0)
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 unsigned
33 */
34 public $id;
35
36 /**
37 * FK to Job
38 *
39 * @var int unsigned
40 */
41 public $job_id;
42
43 /**
44 * FK to Email
45 *
46 * @var int unsigned
47 */
48 public $email_id;
49
50 /**
51 * FK to Contact
52 *
53 * @var int unsigned
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 unsigned
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 'table_name' => 'civicrm_mailing_event_queue',
111 'entity' => 'Queue',
112 'bao' => 'CRM_Mailing_Event_BAO_Queue',
113 'localizable' => 0,
114 ],
115 'job_id' => [
116 'name' => 'job_id',
117 'type' => CRM_Utils_Type::T_INT,
118 'title' => ts('Job ID'),
119 'description' => ts('FK to Job'),
120 'required' => TRUE,
121 'table_name' => 'civicrm_mailing_event_queue',
122 'entity' => 'Queue',
123 'bao' => 'CRM_Mailing_Event_BAO_Queue',
124 'localizable' => 0,
125 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
126 ],
127 'email_id' => [
128 'name' => 'email_id',
129 'type' => CRM_Utils_Type::T_INT,
130 'title' => ts('Email ID'),
131 'description' => ts('FK to Email'),
132 'default' => 'NULL',
133 'table_name' => 'civicrm_mailing_event_queue',
134 'entity' => 'Queue',
135 'bao' => 'CRM_Mailing_Event_BAO_Queue',
136 'localizable' => 0,
137 'FKClassName' => 'CRM_Core_DAO_Email',
138 ],
139 'contact_id' => [
140 'name' => 'contact_id',
141 'type' => CRM_Utils_Type::T_INT,
142 'title' => ts('Contact ID'),
143 'description' => ts('FK to Contact'),
144 'required' => TRUE,
145 'table_name' => 'civicrm_mailing_event_queue',
146 'entity' => 'Queue',
147 'bao' => 'CRM_Mailing_Event_BAO_Queue',
148 'localizable' => 0,
149 'FKClassName' => 'CRM_Contact_DAO_Contact',
150 ],
151 'hash' => [
152 'name' => 'hash',
153 'type' => CRM_Utils_Type::T_STRING,
154 'title' => ts('Security Hash'),
155 'description' => ts('Security hash'),
156 'required' => TRUE,
157 'maxlength' => 255,
158 'size' => CRM_Utils_Type::HUGE,
159 'table_name' => 'civicrm_mailing_event_queue',
160 'entity' => 'Queue',
161 'bao' => 'CRM_Mailing_Event_BAO_Queue',
162 'localizable' => 0,
163 ],
164 'phone_id' => [
165 'name' => 'phone_id',
166 'type' => CRM_Utils_Type::T_INT,
167 'title' => ts('Phone ID'),
168 'description' => ts('FK to Phone'),
169 'default' => 'NULL',
170 'table_name' => 'civicrm_mailing_event_queue',
171 'entity' => 'Queue',
172 'bao' => 'CRM_Mailing_Event_BAO_Queue',
173 'localizable' => 0,
174 'FKClassName' => 'CRM_Core_DAO_Phone',
175 ],
176 ];
177 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
178 }
179 return Civi::$statics[__CLASS__]['fields'];
180 }
181
182 /**
183 * Return a mapping from field-name to the corresponding key (as used in fields()).
184 *
185 * @return array
186 * Array(string $name => string $uniqueName).
187 */
188 public static function &fieldKeys() {
189 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
190 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
191 }
192 return Civi::$statics[__CLASS__]['fieldKeys'];
193 }
194
195 /**
196 * Returns the names of this table
197 *
198 * @return string
199 */
200 public static function getTableName() {
201 return self::$_tableName;
202 }
203
204 /**
205 * Returns if this table needs to be logged
206 *
207 * @return bool
208 */
209 public function getLog() {
210 return self::$_log;
211 }
212
213 /**
214 * Returns the list of fields that can be imported
215 *
216 * @param bool $prefix
217 *
218 * @return array
219 */
220 public static function &import($prefix = FALSE) {
221 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_queue', $prefix, []);
222 return $r;
223 }
224
225 /**
226 * Returns the list of fields that can be exported
227 *
228 * @param bool $prefix
229 *
230 * @return array
231 */
232 public static function &export($prefix = FALSE) {
233 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_queue', $prefix, []);
234 return $r;
235 }
236
237 /**
238 * Returns the list of indices
239 *
240 * @param bool $localize
241 *
242 * @return array
243 */
244 public static function indices($localize = TRUE) {
245 $indices = [
246 'index_hash' => [
247 'name' => 'index_hash',
248 'field' => [
249 0 => 'hash',
250 ],
251 'localizable' => FALSE,
252 'sig' => 'civicrm_mailing_event_queue::0::hash',
253 ],
254 ];
255 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
256 }
257
258 }