Commit | Line | Data |
---|---|---|
e501603b TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
4 | | CiviCRM version 4.7 | | |
5 | +--------------------------------------------------------------------+ | |
0f03f337 | 6 | | Copyright CiviCRM LLC (c) 2004-2017 | |
e501603b TO |
7 | +--------------------------------------------------------------------+ |
8 | | This file is a part of CiviCRM. | | |
9 | | | | |
10 | | CiviCRM is free software; you can copy, modify, and distribute it | | |
11 | | under the terms of the GNU Affero General Public License | | |
12 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | |
13 | | | | |
14 | | CiviCRM is distributed in the hope that it will be useful, but | | |
15 | | WITHOUT ANY WARRANTY; without even the implied warranty of | | |
16 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | |
17 | | See the GNU Affero General Public License for more details. | | |
18 | | | | |
19 | | You should have received a copy of the GNU Affero General Public | | |
20 | | License and the CiviCRM Licensing Exception along | | |
21 | | with this program; if not, contact CiviCRM LLC | | |
22 | | at info[AT]civicrm[DOT]org. If you have questions about the | | |
23 | | GNU Affero General Public License or the licensing of CiviCRM, | | |
24 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | | |
25 | +--------------------------------------------------------------------+ | |
26 | */ | |
27 | /** | |
28 | * @package CRM | |
0f03f337 | 29 | * @copyright CiviCRM LLC (c) 2004-2017 |
e501603b TO |
30 | * |
31 | * Generated from xml/schema/CRM/Mailing/Event/Queue.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
ab49600a | 33 | * (GenCodeChecksum:61df95ab05407c3c8fcd677a03e32b99) |
e501603b TO |
34 | */ |
35 | require_once 'CRM/Core/DAO.php'; | |
36 | require_once 'CRM/Utils/Type.php'; | |
f41f0342 | 37 | /** |
38 | * CRM_Mailing_Event_DAO_Queue constructor. | |
39 | */ | |
e501603b TO |
40 | class CRM_Mailing_Event_DAO_Queue extends CRM_Core_DAO { |
41 | /** | |
f41f0342 | 42 | * Static instance to hold the table name. |
e501603b TO |
43 | * |
44 | * @var string | |
45 | */ | |
46 | static $_tableName = 'civicrm_mailing_event_queue'; | |
e501603b | 47 | /** |
f41f0342 | 48 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b TO |
49 | * |
50 | * @var boolean | |
51 | */ | |
52 | static $_log = false; | |
53 | /** | |
54 | * | |
55 | * @var int unsigned | |
56 | */ | |
57 | public $id; | |
58 | /** | |
59 | * FK to Job | |
60 | * | |
61 | * @var int unsigned | |
62 | */ | |
63 | public $job_id; | |
64 | /** | |
65 | * FK to Email | |
66 | * | |
67 | * @var int unsigned | |
68 | */ | |
69 | public $email_id; | |
70 | /** | |
71 | * FK to Contact | |
72 | * | |
73 | * @var int unsigned | |
74 | */ | |
75 | public $contact_id; | |
76 | /** | |
77 | * Security hash | |
78 | * | |
79 | * @var string | |
80 | */ | |
81 | public $hash; | |
82 | /** | |
83 | * FK to Phone | |
84 | * | |
85 | * @var int unsigned | |
86 | */ | |
87 | public $phone_id; | |
88 | /** | |
f41f0342 | 89 | * Class constructor. |
e501603b TO |
90 | */ |
91 | function __construct() { | |
92 | $this->__table = 'civicrm_mailing_event_queue'; | |
93 | parent::__construct(); | |
94 | } | |
95 | /** | |
f41f0342 | 96 | * Returns foreign keys and entity references. |
e501603b TO |
97 | * |
98 | * @return array | |
99 | * [CRM_Core_Reference_Interface] | |
100 | */ | |
101 | static function getReferenceColumns() { | |
346aaaba TO |
102 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
103 | Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__); | |
104 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'job_id', 'civicrm_mailing_job', 'id'); | |
105 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'email_id', 'civicrm_email', 'id'); | |
106 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); | |
107 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'phone_id', 'civicrm_phone', 'id'); | |
108 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); | |
e501603b | 109 | } |
346aaaba | 110 | return Civi::$statics[__CLASS__]['links']; |
e501603b TO |
111 | } |
112 | /** | |
113 | * Returns all the column names of this table | |
114 | * | |
115 | * @return array | |
116 | */ | |
117 | static function &fields() { | |
346aaaba TO |
118 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
119 | Civi::$statics[__CLASS__]['fields'] = array( | |
e501603b TO |
120 | 'id' => array( |
121 | 'name' => 'id', | |
122 | 'type' => CRM_Utils_Type::T_INT, | |
123 | 'title' => ts('Mailing Event Queue ID') , | |
124 | 'required' => true, | |
522a26c9 | 125 | 'table_name' => 'civicrm_mailing_event_queue', |
126 | 'entity' => 'Queue', | |
127 | 'bao' => 'CRM_Mailing_Event_BAO_Queue', | |
6a7e5e5d | 128 | 'localizable' => 0, |
e501603b TO |
129 | ) , |
130 | 'job_id' => array( | |
131 | 'name' => 'job_id', | |
132 | 'type' => CRM_Utils_Type::T_INT, | |
133 | 'title' => ts('Job ID') , | |
134 | 'description' => 'FK to Job', | |
135 | 'required' => true, | |
522a26c9 | 136 | 'table_name' => 'civicrm_mailing_event_queue', |
137 | 'entity' => 'Queue', | |
138 | 'bao' => 'CRM_Mailing_Event_BAO_Queue', | |
6a7e5e5d | 139 | 'localizable' => 0, |
e501603b TO |
140 | 'FKClassName' => 'CRM_Mailing_DAO_MailingJob', |
141 | ) , | |
142 | 'email_id' => array( | |
143 | 'name' => 'email_id', | |
144 | 'type' => CRM_Utils_Type::T_INT, | |
145 | 'title' => ts('Email ID') , | |
146 | 'description' => 'FK to Email', | |
147 | 'default' => 'NULL', | |
522a26c9 | 148 | 'table_name' => 'civicrm_mailing_event_queue', |
149 | 'entity' => 'Queue', | |
150 | 'bao' => 'CRM_Mailing_Event_BAO_Queue', | |
6a7e5e5d | 151 | 'localizable' => 0, |
e501603b TO |
152 | 'FKClassName' => 'CRM_Core_DAO_Email', |
153 | ) , | |
154 | 'contact_id' => array( | |
155 | 'name' => 'contact_id', | |
156 | 'type' => CRM_Utils_Type::T_INT, | |
157 | 'title' => ts('Contact ID') , | |
158 | 'description' => 'FK to Contact', | |
159 | 'required' => true, | |
522a26c9 | 160 | 'table_name' => 'civicrm_mailing_event_queue', |
161 | 'entity' => 'Queue', | |
162 | 'bao' => 'CRM_Mailing_Event_BAO_Queue', | |
6a7e5e5d | 163 | 'localizable' => 0, |
e501603b TO |
164 | 'FKClassName' => 'CRM_Contact_DAO_Contact', |
165 | ) , | |
166 | 'hash' => array( | |
167 | 'name' => 'hash', | |
168 | 'type' => CRM_Utils_Type::T_STRING, | |
169 | 'title' => ts('Security Hash') , | |
170 | 'description' => 'Security hash', | |
171 | 'required' => true, | |
172 | 'maxlength' => 255, | |
173 | 'size' => CRM_Utils_Type::HUGE, | |
522a26c9 | 174 | 'table_name' => 'civicrm_mailing_event_queue', |
175 | 'entity' => 'Queue', | |
176 | 'bao' => 'CRM_Mailing_Event_BAO_Queue', | |
6a7e5e5d | 177 | 'localizable' => 0, |
e501603b TO |
178 | ) , |
179 | 'phone_id' => array( | |
180 | 'name' => 'phone_id', | |
181 | 'type' => CRM_Utils_Type::T_INT, | |
182 | 'title' => ts('Phone ID') , | |
183 | 'description' => 'FK to Phone', | |
184 | 'default' => 'NULL', | |
522a26c9 | 185 | 'table_name' => 'civicrm_mailing_event_queue', |
186 | 'entity' => 'Queue', | |
187 | 'bao' => 'CRM_Mailing_Event_BAO_Queue', | |
6a7e5e5d | 188 | 'localizable' => 0, |
e501603b TO |
189 | 'FKClassName' => 'CRM_Core_DAO_Phone', |
190 | ) , | |
191 | ); | |
346aaaba | 192 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 193 | } |
346aaaba | 194 | return Civi::$statics[__CLASS__]['fields']; |
e501603b TO |
195 | } |
196 | /** | |
bd8e0b14 | 197 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
198 | * |
199 | * @return array | |
bd8e0b14 | 200 | * Array(string $name => string $uniqueName). |
e501603b TO |
201 | */ |
202 | static function &fieldKeys() { | |
bd8e0b14 TO |
203 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
204 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 205 | } |
bd8e0b14 | 206 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b TO |
207 | } |
208 | /** | |
209 | * Returns the names of this table | |
210 | * | |
211 | * @return string | |
212 | */ | |
213 | static function getTableName() { | |
214 | return self::$_tableName; | |
215 | } | |
216 | /** | |
217 | * Returns if this table needs to be logged | |
218 | * | |
219 | * @return boolean | |
220 | */ | |
221 | function getLog() { | |
222 | return self::$_log; | |
223 | } | |
224 | /** | |
225 | * Returns the list of fields that can be imported | |
226 | * | |
227 | * @param bool $prefix | |
228 | * | |
229 | * @return array | |
230 | */ | |
231 | static function &import($prefix = false) { | |
60808919 TO |
232 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_queue', $prefix, array()); |
233 | return $r; | |
e501603b TO |
234 | } |
235 | /** | |
236 | * Returns the list of fields that can be exported | |
237 | * | |
238 | * @param bool $prefix | |
239 | * | |
240 | * @return array | |
241 | */ | |
242 | static function &export($prefix = false) { | |
60808919 TO |
243 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_queue', $prefix, array()); |
244 | return $r; | |
e501603b | 245 | } |
e7a6b91a AS |
246 | /** |
247 | * Returns the list of indices | |
248 | */ | |
249 | public static function indices($localize = TRUE) { | |
ab49600a SL |
250 | $indices = array( |
251 | 'index_hash' => array( | |
252 | 'name' => 'index_hash', | |
253 | 'field' => array( | |
254 | 0 => 'hash', | |
255 | ) , | |
256 | 'localizable' => false, | |
257 | 'sig' => 'civicrm_mailing_event_queue::0::hash', | |
258 | ) , | |
259 | ); | |
e7a6b91a AS |
260 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
261 | } | |
e501603b | 262 | } |