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