commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-new / civicrm / CRM / Core / DAO / AllCoreTables.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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 *
29 * @package CRM
30 * @copyright CiviCRM LLC (c) 2004-2015
31 * $Id$
32 *
33 */
34 class CRM_Core_DAO_AllCoreTables {
35 static private $tables = null;
36 static private $daoToClass = null;
37 static private $entityTypes = null;
38 static public function init($fresh = FALSE) {
39 static $init = FALSE;
40 if ($init && !$fresh) return;
41 $entityTypes = array(
42 'CRM_Core_DAO_AddressFormat' => array(
43 'name' => 'AddressFormat',
44 'class' => 'CRM_Core_DAO_AddressFormat',
45 'table' => 'civicrm_address_format',
46 ) ,
47 'CRM_Core_DAO_Extension' => array(
48 'name' => 'Extension',
49 'class' => 'CRM_Core_DAO_Extension',
50 'table' => 'civicrm_extension',
51 ) ,
52 'CRM_Core_DAO_File' => array(
53 'name' => 'File',
54 'class' => 'CRM_Core_DAO_File',
55 'table' => 'civicrm_file',
56 ) ,
57 'CRM_Core_DAO_LocationType' => array(
58 'name' => 'LocationType',
59 'class' => 'CRM_Core_DAO_LocationType',
60 'table' => 'civicrm_location_type',
61 ) ,
62 'CRM_Core_DAO_Managed' => array(
63 'name' => 'Managed',
64 'class' => 'CRM_Core_DAO_Managed',
65 'table' => 'civicrm_managed',
66 ) ,
67 'CRM_Core_DAO_Mapping' => array(
68 'name' => 'Mapping',
69 'class' => 'CRM_Core_DAO_Mapping',
70 'table' => 'civicrm_mapping',
71 ) ,
72 'CRM_Core_DAO_MessageTemplate' => array(
73 'name' => 'MessageTemplate',
74 'class' => 'CRM_Core_DAO_MessageTemplate',
75 'table' => 'civicrm_msg_template',
76 ) ,
77 'CRM_Core_DAO_OptionGroup' => array(
78 'name' => 'OptionGroup',
79 'class' => 'CRM_Core_DAO_OptionGroup',
80 'table' => 'civicrm_option_group',
81 ) ,
82 'CRM_Core_DAO_PreferencesDate' => array(
83 'name' => 'PreferencesDate',
84 'class' => 'CRM_Core_DAO_PreferencesDate',
85 'table' => 'civicrm_preferences_date',
86 ) ,
87 'CRM_Core_DAO_SystemLog' => array(
88 'name' => 'SystemLog',
89 'class' => 'CRM_Core_DAO_SystemLog',
90 'table' => 'civicrm_system_log',
91 ) ,
92 'CRM_Core_DAO_Worldregion' => array(
93 'name' => 'Worldregion',
94 'class' => 'CRM_Core_DAO_Worldregion',
95 'table' => 'civicrm_worldregion',
96 ) ,
97 'CRM_Core_DAO_Component' => array(
98 'name' => 'Component',
99 'class' => 'CRM_Core_DAO_Component',
100 'table' => 'civicrm_component',
101 ) ,
102 'CRM_Core_DAO_Persistent' => array(
103 'name' => 'Persistent',
104 'class' => 'CRM_Core_DAO_Persistent',
105 'table' => 'civicrm_persistent',
106 ) ,
107 'CRM_Core_DAO_PrevNextCache' => array(
108 'name' => 'PrevNextCache',
109 'class' => 'CRM_Core_DAO_PrevNextCache',
110 'table' => 'civicrm_prevnext_cache',
111 ) ,
112 'CRM_Core_DAO_ActionMapping' => array(
113 'name' => 'ActionMapping',
114 'class' => 'CRM_Core_DAO_ActionMapping',
115 'table' => 'civicrm_action_mapping',
116 ) ,
117 'CRM_Core_DAO_RecurringEntity' => array(
118 'name' => 'RecurringEntity',
119 'class' => 'CRM_Core_DAO_RecurringEntity',
120 'table' => 'civicrm_recurring_entity',
121 ) ,
122 'CRM_ACL_DAO_ACL' => array(
123 'name' => 'ACL',
124 'class' => 'CRM_ACL_DAO_ACL',
125 'table' => 'civicrm_acl',
126 ) ,
127 'CRM_ACL_DAO_EntityRole' => array(
128 'name' => 'EntityRole',
129 'class' => 'CRM_ACL_DAO_EntityRole',
130 'table' => 'civicrm_acl_entity_role',
131 ) ,
132 'CRM_Contact_DAO_Contact' => array(
133 'name' => 'Contact',
134 'class' => 'CRM_Contact_DAO_Contact',
135 'table' => 'civicrm_contact',
136 ) ,
137 'CRM_Contact_DAO_ACLContactCache' => array(
138 'name' => 'ACLContactCache',
139 'class' => 'CRM_Contact_DAO_ACLContactCache',
140 'table' => 'civicrm_acl_contact_cache',
141 ) ,
142 'CRM_Contact_DAO_RelationshipType' => array(
143 'name' => 'RelationshipType',
144 'class' => 'CRM_Contact_DAO_RelationshipType',
145 'table' => 'civicrm_relationship_type',
146 ) ,
147 'CRM_Contact_DAO_SavedSearch' => array(
148 'name' => 'SavedSearch',
149 'class' => 'CRM_Contact_DAO_SavedSearch',
150 'table' => 'civicrm_saved_search',
151 ) ,
152 'CRM_Contact_DAO_ContactType' => array(
153 'name' => 'ContactType',
154 'class' => 'CRM_Contact_DAO_ContactType',
155 'table' => 'civicrm_contact_type',
156 ) ,
157 'CRM_Batch_DAO_Batch' => array(
158 'name' => 'Batch',
159 'class' => 'CRM_Batch_DAO_Batch',
160 'table' => 'civicrm_batch',
161 ) ,
162 'CRM_Batch_DAO_EntityBatch' => array(
163 'name' => 'EntityBatch',
164 'class' => 'CRM_Batch_DAO_EntityBatch',
165 'table' => 'civicrm_entity_batch',
166 ) ,
167 'CRM_Mailing_DAO_Component' => array(
168 'name' => 'Component',
169 'class' => 'CRM_Mailing_DAO_Component',
170 'table' => 'civicrm_mailing_component',
171 ) ,
172 'CRM_Mailing_DAO_MailingAB' => array(
173 'name' => 'MailingAB',
174 'class' => 'CRM_Mailing_DAO_MailingAB',
175 'table' => 'civicrm_mailing_abtest',
176 ) ,
177 'CRM_Mailing_DAO_BounceType' => array(
178 'name' => 'BounceType',
179 'class' => 'CRM_Mailing_DAO_BounceType',
180 'table' => 'civicrm_mailing_bounce_type',
181 ) ,
182 'CRM_Mailing_DAO_BouncePattern' => array(
183 'name' => 'BouncePattern',
184 'class' => 'CRM_Mailing_DAO_BouncePattern',
185 'table' => 'civicrm_mailing_bounce_pattern',
186 ) ,
187 'CRM_Contribute_DAO_Premium' => array(
188 'name' => 'Premium',
189 'class' => 'CRM_Contribute_DAO_Premium',
190 'table' => 'civicrm_premiums',
191 ) ,
192 'CRM_Financial_DAO_Currency' => array(
193 'name' => 'Currency',
194 'class' => 'CRM_Financial_DAO_Currency',
195 'table' => 'civicrm_currency',
196 ) ,
197 'CRM_Financial_DAO_FinancialAccount' => array(
198 'name' => 'FinancialAccount',
199 'class' => 'CRM_Financial_DAO_FinancialAccount',
200 'table' => 'civicrm_financial_account',
201 ) ,
202 'CRM_Financial_DAO_PaymentProcessorType' => array(
203 'name' => 'PaymentProcessorType',
204 'class' => 'CRM_Financial_DAO_PaymentProcessorType',
205 'table' => 'civicrm_payment_processor_type',
206 ) ,
207 'CRM_Financial_DAO_FinancialType' => array(
208 'name' => 'FinancialType',
209 'class' => 'CRM_Financial_DAO_FinancialType',
210 'table' => 'civicrm_financial_type',
211 ) ,
212 'CRM_Financial_DAO_EntityFinancialAccount' => array(
213 'name' => 'EntityFinancialAccount',
214 'class' => 'CRM_Financial_DAO_EntityFinancialAccount',
215 'table' => 'civicrm_entity_financial_account',
216 ) ,
217 'CRM_Financial_DAO_FinancialItem' => array(
218 'name' => 'FinancialItem',
219 'class' => 'CRM_Financial_DAO_FinancialItem',
220 'table' => 'civicrm_financial_item',
221 ) ,
222 'CRM_SMS_DAO_Provider' => array(
223 'name' => 'Provider',
224 'class' => 'CRM_SMS_DAO_Provider',
225 'table' => 'civicrm_sms_provider',
226 ) ,
227 'CRM_Member_DAO_MembershipStatus' => array(
228 'name' => 'MembershipStatus',
229 'class' => 'CRM_Member_DAO_MembershipStatus',
230 'table' => 'civicrm_membership_status',
231 ) ,
232 'CRM_Campaign_DAO_Campaign' => array(
233 'name' => 'Campaign',
234 'class' => 'CRM_Campaign_DAO_Campaign',
235 'table' => 'civicrm_campaign',
236 ) ,
237 'CRM_Campaign_DAO_CampaignGroup' => array(
238 'name' => 'CampaignGroup',
239 'class' => 'CRM_Campaign_DAO_CampaignGroup',
240 'table' => 'civicrm_campaign_group',
241 ) ,
242 'CRM_Campaign_DAO_Survey' => array(
243 'name' => 'Survey',
244 'class' => 'CRM_Campaign_DAO_Survey',
245 'table' => 'civicrm_survey',
246 ) ,
247 'CRM_Event_DAO_ParticipantStatusType' => array(
248 'name' => 'ParticipantStatusType',
249 'class' => 'CRM_Event_DAO_ParticipantStatusType',
250 'table' => 'civicrm_participant_status_type',
251 ) ,
252 'CRM_Event_Cart_DAO_Cart' => array(
253 'name' => 'Cart',
254 'class' => 'CRM_Event_Cart_DAO_Cart',
255 'table' => 'civicrm_event_carts',
256 ) ,
257 'CRM_Dedupe_DAO_RuleGroup' => array(
258 'name' => 'RuleGroup',
259 'class' => 'CRM_Dedupe_DAO_RuleGroup',
260 'table' => 'civicrm_dedupe_rule_group',
261 ) ,
262 'CRM_Dedupe_DAO_Rule' => array(
263 'name' => 'Rule',
264 'class' => 'CRM_Dedupe_DAO_Rule',
265 'table' => 'civicrm_dedupe_rule',
266 ) ,
267 'CRM_Dedupe_DAO_Exception' => array(
268 'name' => 'Exception',
269 'class' => 'CRM_Dedupe_DAO_Exception',
270 'table' => 'civicrm_dedupe_exception',
271 ) ,
272 'CRM_Case_DAO_CaseType' => array(
273 'name' => 'CaseType',
274 'class' => 'CRM_Case_DAO_CaseType',
275 'table' => 'civicrm_case_type',
276 ) ,
277 'CRM_Grant_DAO_Grant' => array(
278 'name' => 'Grant',
279 'class' => 'CRM_Grant_DAO_Grant',
280 'table' => 'civicrm_grant',
281 ) ,
282 'CRM_Friend_DAO_Friend' => array(
283 'name' => 'Friend',
284 'class' => 'CRM_Friend_DAO_Friend',
285 'table' => 'civicrm_tell_friend',
286 ) ,
287 'CRM_Pledge_DAO_PledgeBlock' => array(
288 'name' => 'PledgeBlock',
289 'class' => 'CRM_Pledge_DAO_PledgeBlock',
290 'table' => 'civicrm_pledge_block',
291 ) ,
292 'CRM_Queue_DAO_QueueItem' => array(
293 'name' => 'QueueItem',
294 'class' => 'CRM_Queue_DAO_QueueItem',
295 'table' => 'civicrm_queue_item',
296 ) ,
297 'CRM_PCP_DAO_PCP' => array(
298 'name' => 'PCP',
299 'class' => 'CRM_PCP_DAO_PCP',
300 'table' => 'civicrm_pcp',
301 ) ,
302 'CRM_Cxn_DAO_Cxn' => array(
303 'name' => 'Cxn',
304 'class' => 'CRM_Cxn_DAO_Cxn',
305 'table' => 'civicrm_cxn',
306 ) ,
307 'CRM_Core_DAO_Cache' => array(
308 'name' => 'Cache',
309 'class' => 'CRM_Core_DAO_Cache',
310 'table' => 'civicrm_cache',
311 ) ,
312 'CRM_Core_DAO_Country' => array(
313 'name' => 'Country',
314 'class' => 'CRM_Core_DAO_Country',
315 'table' => 'civicrm_country',
316 ) ,
317 'CRM_Core_DAO_CustomGroup' => array(
318 'name' => 'CustomGroup',
319 'class' => 'CRM_Core_DAO_CustomGroup',
320 'table' => 'civicrm_custom_group',
321 ) ,
322 'CRM_Core_DAO_CustomField' => array(
323 'name' => 'CustomField',
324 'class' => 'CRM_Core_DAO_CustomField',
325 'table' => 'civicrm_custom_field',
326 ) ,
327 'CRM_Core_DAO_Domain' => array(
328 'name' => 'Domain',
329 'class' => 'CRM_Core_DAO_Domain',
330 'table' => 'civicrm_domain',
331 ) ,
332 'CRM_Core_DAO_Email' => array(
333 'name' => 'Email',
334 'class' => 'CRM_Core_DAO_Email',
335 'table' => 'civicrm_email',
336 ) ,
337 'CRM_Core_DAO_EntityFile' => array(
338 'name' => 'EntityFile',
339 'class' => 'CRM_Core_DAO_EntityFile',
340 'table' => 'civicrm_entity_file',
341 ) ,
342 'CRM_Core_DAO_IM' => array(
343 'name' => 'IM',
344 'class' => 'CRM_Core_DAO_IM',
345 'table' => 'civicrm_im',
346 ) ,
347 'CRM_Core_DAO_Job' => array(
348 'name' => 'Job',
349 'class' => 'CRM_Core_DAO_Job',
350 'table' => 'civicrm_job',
351 ) ,
352 'CRM_Core_DAO_JobLog' => array(
353 'name' => 'JobLog',
354 'class' => 'CRM_Core_DAO_JobLog',
355 'table' => 'civicrm_job_log',
356 ) ,
357 'CRM_Core_DAO_Log' => array(
358 'name' => 'Log',
359 'class' => 'CRM_Core_DAO_Log',
360 'table' => 'civicrm_log',
361 ) ,
362 'CRM_Core_DAO_MailSettings' => array(
363 'name' => 'MailSettings',
364 'class' => 'CRM_Core_DAO_MailSettings',
365 'table' => 'civicrm_mail_settings',
366 ) ,
367 'CRM_Core_DAO_MappingField' => array(
368 'name' => 'MappingField',
369 'class' => 'CRM_Core_DAO_MappingField',
370 'table' => 'civicrm_mapping_field',
371 ) ,
372 'CRM_Core_DAO_Menu' => array(
373 'name' => 'Menu',
374 'class' => 'CRM_Core_DAO_Menu',
375 'table' => 'civicrm_menu',
376 ) ,
377 'CRM_Core_DAO_Navigation' => array(
378 'name' => 'Navigation',
379 'class' => 'CRM_Core_DAO_Navigation',
380 'table' => 'civicrm_navigation',
381 ) ,
382 'CRM_Core_DAO_Note' => array(
383 'name' => 'Note',
384 'class' => 'CRM_Core_DAO_Note',
385 'table' => 'civicrm_note',
386 ) ,
387 'CRM_Core_DAO_OptionValue' => array(
388 'name' => 'OptionValue',
389 'class' => 'CRM_Core_DAO_OptionValue',
390 'table' => 'civicrm_option_value',
391 ) ,
392 'CRM_Core_DAO_Phone' => array(
393 'name' => 'Phone',
394 'class' => 'CRM_Core_DAO_Phone',
395 'table' => 'civicrm_phone',
396 ) ,
397 'CRM_Core_DAO_StateProvince' => array(
398 'name' => 'StateProvince',
399 'class' => 'CRM_Core_DAO_StateProvince',
400 'table' => 'civicrm_state_province',
401 ) ,
402 'CRM_Core_DAO_Tag' => array(
403 'name' => 'Tag',
404 'class' => 'CRM_Core_DAO_Tag',
405 'table' => 'civicrm_tag',
406 ) ,
407 'CRM_Core_DAO_UFMatch' => array(
408 'name' => 'UFMatch',
409 'class' => 'CRM_Core_DAO_UFMatch',
410 'table' => 'civicrm_uf_match',
411 ) ,
412 'CRM_Core_DAO_Timezone' => array(
413 'name' => 'Timezone',
414 'class' => 'CRM_Core_DAO_Timezone',
415 'table' => 'civicrm_timezone',
416 ) ,
417 'CRM_Core_DAO_OpenID' => array(
418 'name' => 'OpenID',
419 'class' => 'CRM_Core_DAO_OpenID',
420 'table' => 'civicrm_openid',
421 ) ,
422 'CRM_Core_DAO_Website' => array(
423 'name' => 'Website',
424 'class' => 'CRM_Core_DAO_Website',
425 'table' => 'civicrm_website',
426 ) ,
427 'CRM_Core_DAO_Setting' => array(
428 'name' => 'Setting',
429 'class' => 'CRM_Core_DAO_Setting',
430 'table' => 'civicrm_setting',
431 ) ,
432 'CRM_Core_DAO_PrintLabel' => array(
433 'name' => 'PrintLabel',
434 'class' => 'CRM_Core_DAO_PrintLabel',
435 'table' => 'civicrm_print_label',
436 ) ,
437 'CRM_Core_DAO_WordReplacement' => array(
438 'name' => 'WordReplacement',
439 'class' => 'CRM_Core_DAO_WordReplacement',
440 'table' => 'civicrm_word_replacement',
441 ) ,
442 'CRM_ACL_DAO_Cache' => array(
443 'name' => 'Cache',
444 'class' => 'CRM_ACL_DAO_Cache',
445 'table' => 'civicrm_acl_cache',
446 ) ,
447 'CRM_Contact_DAO_Group' => array(
448 'name' => 'Group',
449 'class' => 'CRM_Contact_DAO_Group',
450 'table' => 'civicrm_group',
451 ) ,
452 'CRM_Contact_DAO_SubscriptionHistory' => array(
453 'name' => 'SubscriptionHistory',
454 'class' => 'CRM_Contact_DAO_SubscriptionHistory',
455 'table' => 'civicrm_subscription_history',
456 ) ,
457 'CRM_Contact_DAO_GroupContactCache' => array(
458 'name' => 'GroupContactCache',
459 'class' => 'CRM_Contact_DAO_GroupContactCache',
460 'table' => 'civicrm_group_contact_cache',
461 ) ,
462 'CRM_Contact_DAO_GroupNesting' => array(
463 'name' => 'GroupNesting',
464 'class' => 'CRM_Contact_DAO_GroupNesting',
465 'table' => 'civicrm_group_nesting',
466 ) ,
467 'CRM_Contact_DAO_GroupOrganization' => array(
468 'name' => 'GroupOrganization',
469 'class' => 'CRM_Contact_DAO_GroupOrganization',
470 'table' => 'civicrm_group_organization',
471 ) ,
472 'CRM_Mailing_DAO_Mailing' => array(
473 'name' => 'Mailing',
474 'class' => 'CRM_Mailing_DAO_Mailing',
475 'table' => 'civicrm_mailing',
476 ) ,
477 'CRM_Mailing_DAO_MailingGroup' => array(
478 'name' => 'MailingGroup',
479 'class' => 'CRM_Mailing_DAO_MailingGroup',
480 'table' => 'civicrm_mailing_group',
481 ) ,
482 'CRM_Mailing_DAO_TrackableURL' => array(
483 'name' => 'TrackableURL',
484 'class' => 'CRM_Mailing_DAO_TrackableURL',
485 'table' => 'civicrm_mailing_trackable_url',
486 ) ,
487 'CRM_Mailing_DAO_MailingJob' => array(
488 'name' => 'MailingJob',
489 'class' => 'CRM_Mailing_DAO_MailingJob',
490 'table' => 'civicrm_mailing_job',
491 ) ,
492 'CRM_Mailing_DAO_Recipients' => array(
493 'name' => 'Recipients',
494 'class' => 'CRM_Mailing_DAO_Recipients',
495 'table' => 'civicrm_mailing_recipients',
496 ) ,
497 'CRM_Mailing_DAO_Spool' => array(
498 'name' => 'Spool',
499 'class' => 'CRM_Mailing_DAO_Spool',
500 'table' => 'civicrm_mailing_spool',
501 ) ,
502 'CRM_Mailing_Event_DAO_Queue' => array(
503 'name' => 'Queue',
504 'class' => 'CRM_Mailing_Event_DAO_Queue',
505 'table' => 'civicrm_mailing_event_queue',
506 ) ,
507 'CRM_Mailing_Event_DAO_Bounce' => array(
508 'name' => 'Bounce',
509 'class' => 'CRM_Mailing_Event_DAO_Bounce',
510 'table' => 'civicrm_mailing_event_bounce',
511 ) ,
512 'CRM_Mailing_Event_DAO_Delivered' => array(
513 'name' => 'Delivered',
514 'class' => 'CRM_Mailing_Event_DAO_Delivered',
515 'table' => 'civicrm_mailing_event_delivered',
516 ) ,
517 'CRM_Mailing_Event_DAO_Forward' => array(
518 'name' => 'Forward',
519 'class' => 'CRM_Mailing_Event_DAO_Forward',
520 'table' => 'civicrm_mailing_event_forward',
521 ) ,
522 'CRM_Mailing_Event_DAO_Opened' => array(
523 'name' => 'Opened',
524 'class' => 'CRM_Mailing_Event_DAO_Opened',
525 'table' => 'civicrm_mailing_event_opened',
526 ) ,
527 'CRM_Mailing_Event_DAO_Reply' => array(
528 'name' => 'Reply',
529 'class' => 'CRM_Mailing_Event_DAO_Reply',
530 'table' => 'civicrm_mailing_event_reply',
531 ) ,
532 'CRM_Mailing_Event_DAO_Subscribe' => array(
533 'name' => 'Subscribe',
534 'class' => 'CRM_Mailing_Event_DAO_Subscribe',
535 'table' => 'civicrm_mailing_event_subscribe',
536 ) ,
537 'CRM_Mailing_Event_DAO_Confirm' => array(
538 'name' => 'Confirm',
539 'class' => 'CRM_Mailing_Event_DAO_Confirm',
540 'table' => 'civicrm_mailing_event_confirm',
541 ) ,
542 'CRM_Mailing_Event_DAO_TrackableURLOpen' => array(
543 'name' => 'TrackableURLOpen',
544 'class' => 'CRM_Mailing_Event_DAO_TrackableURLOpen',
545 'table' => 'civicrm_mailing_event_trackable_url_open',
546 ) ,
547 'CRM_Mailing_Event_DAO_Unsubscribe' => array(
548 'name' => 'Unsubscribe',
549 'class' => 'CRM_Mailing_Event_DAO_Unsubscribe',
550 'table' => 'civicrm_mailing_event_unsubscribe',
551 ) ,
552 'CRM_Contribute_DAO_ContributionPage' => array(
553 'name' => 'ContributionPage',
554 'class' => 'CRM_Contribute_DAO_ContributionPage',
555 'table' => 'civicrm_contribution_page',
556 ) ,
557 'CRM_Contribute_DAO_Product' => array(
558 'name' => 'Product',
559 'class' => 'CRM_Contribute_DAO_Product',
560 'table' => 'civicrm_product',
561 ) ,
562 'CRM_Contribute_DAO_PremiumsProduct' => array(
563 'name' => 'PremiumsProduct',
564 'class' => 'CRM_Contribute_DAO_PremiumsProduct',
565 'table' => 'civicrm_premiums_product',
566 ) ,
567 'CRM_Contribute_DAO_Widget' => array(
568 'name' => 'Widget',
569 'class' => 'CRM_Contribute_DAO_Widget',
570 'table' => 'civicrm_contribution_widget',
571 ) ,
572 'CRM_Financial_DAO_PaymentProcessor' => array(
573 'name' => 'PaymentProcessor',
574 'class' => 'CRM_Financial_DAO_PaymentProcessor',
575 'table' => 'civicrm_payment_processor',
576 ) ,
577 'CRM_Financial_DAO_PaymentToken' => array(
578 'name' => 'PaymentToken',
579 'class' => 'CRM_Financial_DAO_PaymentToken',
580 'table' => 'civicrm_payment_token',
581 ) ,
582 'CRM_Member_DAO_MembershipType' => array(
583 'name' => 'MembershipType',
584 'class' => 'CRM_Member_DAO_MembershipType',
585 'table' => 'civicrm_membership_type',
586 ) ,
587 'CRM_Member_DAO_MembershipBlock' => array(
588 'name' => 'MembershipBlock',
589 'class' => 'CRM_Member_DAO_MembershipBlock',
590 'table' => 'civicrm_membership_block',
591 ) ,
592 'CRM_Case_DAO_Case' => array(
593 'name' => 'Case',
594 'class' => 'CRM_Case_DAO_Case',
595 'table' => 'civicrm_case',
596 ) ,
597 'CRM_Case_DAO_CaseContact' => array(
598 'name' => 'CaseContact',
599 'class' => 'CRM_Case_DAO_CaseContact',
600 'table' => 'civicrm_case_contact',
601 ) ,
602 'CRM_Pledge_DAO_Pledge' => array(
603 'name' => 'Pledge',
604 'class' => 'CRM_Pledge_DAO_Pledge',
605 'table' => 'civicrm_pledge',
606 ) ,
607 'CRM_Report_DAO_ReportInstance' => array(
608 'name' => 'ReportInstance',
609 'class' => 'CRM_Report_DAO_ReportInstance',
610 'table' => 'civicrm_report_instance',
611 ) ,
612 'CRM_Price_DAO_PriceSet' => array(
613 'name' => 'PriceSet',
614 'class' => 'CRM_Price_DAO_PriceSet',
615 'table' => 'civicrm_price_set',
616 ) ,
617 'CRM_Price_DAO_PriceSetEntity' => array(
618 'name' => 'PriceSetEntity',
619 'class' => 'CRM_Price_DAO_PriceSetEntity',
620 'table' => 'civicrm_price_set_entity',
621 ) ,
622 'CRM_Core_DAO_County' => array(
623 'name' => 'County',
624 'class' => 'CRM_Core_DAO_County',
625 'table' => 'civicrm_county',
626 ) ,
627 'CRM_Core_DAO_Dashboard' => array(
628 'name' => 'Dashboard',
629 'class' => 'CRM_Core_DAO_Dashboard',
630 'table' => 'civicrm_dashboard',
631 ) ,
632 'CRM_Core_DAO_Discount' => array(
633 'name' => 'Discount',
634 'class' => 'CRM_Core_DAO_Discount',
635 'table' => 'civicrm_discount',
636 ) ,
637 'CRM_Core_DAO_EntityTag' => array(
638 'name' => 'EntityTag',
639 'class' => 'CRM_Core_DAO_EntityTag',
640 'table' => 'civicrm_entity_tag',
641 ) ,
642 'CRM_Core_DAO_UFGroup' => array(
643 'name' => 'UFGroup',
644 'class' => 'CRM_Core_DAO_UFGroup',
645 'table' => 'civicrm_uf_group',
646 ) ,
647 'CRM_Core_DAO_UFField' => array(
648 'name' => 'UFField',
649 'class' => 'CRM_Core_DAO_UFField',
650 'table' => 'civicrm_uf_field',
651 ) ,
652 'CRM_Core_DAO_UFJoin' => array(
653 'name' => 'UFJoin',
654 'class' => 'CRM_Core_DAO_UFJoin',
655 'table' => 'civicrm_uf_join',
656 ) ,
657 'CRM_Core_DAO_ActionSchedule' => array(
658 'name' => 'ActionSchedule',
659 'class' => 'CRM_Core_DAO_ActionSchedule',
660 'table' => 'civicrm_action_schedule',
661 ) ,
662 'CRM_Core_DAO_ActionLog' => array(
663 'name' => 'ActionLog',
664 'class' => 'CRM_Core_DAO_ActionLog',
665 'table' => 'civicrm_action_log',
666 ) ,
667 'CRM_Contact_DAO_DashboardContact' => array(
668 'name' => 'DashboardContact',
669 'class' => 'CRM_Contact_DAO_DashboardContact',
670 'table' => 'civicrm_dashboard_contact',
671 ) ,
672 'CRM_Contact_DAO_Relationship' => array(
673 'name' => 'Relationship',
674 'class' => 'CRM_Contact_DAO_Relationship',
675 'table' => 'civicrm_relationship',
676 ) ,
677 'CRM_Contribute_DAO_ContributionRecur' => array(
678 'name' => 'ContributionRecur',
679 'class' => 'CRM_Contribute_DAO_ContributionRecur',
680 'table' => 'civicrm_contribution_recur',
681 ) ,
682 'CRM_Financial_DAO_FinancialTrxn' => array(
683 'name' => 'FinancialTrxn',
684 'class' => 'CRM_Financial_DAO_FinancialTrxn',
685 'table' => 'civicrm_financial_trxn',
686 ) ,
687 'CRM_Member_DAO_Membership' => array(
688 'name' => 'Membership',
689 'class' => 'CRM_Member_DAO_Membership',
690 'table' => 'civicrm_membership',
691 ) ,
692 'CRM_Member_DAO_MembershipLog' => array(
693 'name' => 'MembershipLog',
694 'class' => 'CRM_Member_DAO_MembershipLog',
695 'table' => 'civicrm_membership_log',
696 ) ,
697 'CRM_Activity_DAO_Activity' => array(
698 'name' => 'Activity',
699 'class' => 'CRM_Activity_DAO_Activity',
700 'table' => 'civicrm_activity',
701 ) ,
702 'CRM_Activity_DAO_ActivityContact' => array(
703 'name' => 'ActivityContact',
704 'class' => 'CRM_Activity_DAO_ActivityContact',
705 'table' => 'civicrm_activity_contact',
706 ) ,
707 'CRM_Case_DAO_CaseActivity' => array(
708 'name' => 'CaseActivity',
709 'class' => 'CRM_Case_DAO_CaseActivity',
710 'table' => 'civicrm_case_activity',
711 ) ,
712 'CRM_Price_DAO_PriceField' => array(
713 'name' => 'PriceField',
714 'class' => 'CRM_Price_DAO_PriceField',
715 'table' => 'civicrm_price_field',
716 ) ,
717 'CRM_Price_DAO_PriceFieldValue' => array(
718 'name' => 'PriceFieldValue',
719 'class' => 'CRM_Price_DAO_PriceFieldValue',
720 'table' => 'civicrm_price_field_value',
721 ) ,
722 'CRM_PCP_DAO_PCPBlock' => array(
723 'name' => 'PCPBlock',
724 'class' => 'CRM_PCP_DAO_PCPBlock',
725 'table' => 'civicrm_pcp_block',
726 ) ,
727 'CRM_Core_DAO_Address' => array(
728 'name' => 'Address',
729 'class' => 'CRM_Core_DAO_Address',
730 'table' => 'civicrm_address',
731 ) ,
732 'CRM_Core_DAO_LocBlock' => array(
733 'name' => 'LocBlock',
734 'class' => 'CRM_Core_DAO_LocBlock',
735 'table' => 'civicrm_loc_block',
736 ) ,
737 'CRM_Contact_DAO_GroupContact' => array(
738 'name' => 'GroupContact',
739 'class' => 'CRM_Contact_DAO_GroupContact',
740 'table' => 'civicrm_group_contact',
741 ) ,
742 'CRM_Contribute_DAO_Contribution' => array(
743 'name' => 'Contribution',
744 'class' => 'CRM_Contribute_DAO_Contribution',
745 'table' => 'civicrm_contribution',
746 ) ,
747 'CRM_Contribute_DAO_ContributionProduct' => array(
748 'name' => 'ContributionProduct',
749 'class' => 'CRM_Contribute_DAO_ContributionProduct',
750 'table' => 'civicrm_contribution_product',
751 ) ,
752 'CRM_Contribute_DAO_ContributionSoft' => array(
753 'name' => 'ContributionSoft',
754 'class' => 'CRM_Contribute_DAO_ContributionSoft',
755 'table' => 'civicrm_contribution_soft',
756 ) ,
757 'CRM_Financial_DAO_EntityFinancialTrxn' => array(
758 'name' => 'EntityFinancialTrxn',
759 'class' => 'CRM_Financial_DAO_EntityFinancialTrxn',
760 'table' => 'civicrm_entity_financial_trxn',
761 ) ,
762 'CRM_Member_DAO_MembershipPayment' => array(
763 'name' => 'MembershipPayment',
764 'class' => 'CRM_Member_DAO_MembershipPayment',
765 'table' => 'civicrm_membership_payment',
766 ) ,
767 'CRM_Event_DAO_Event' => array(
768 'name' => 'Event',
769 'class' => 'CRM_Event_DAO_Event',
770 'table' => 'civicrm_event',
771 ) ,
772 'CRM_Event_DAO_Participant' => array(
773 'name' => 'Participant',
774 'class' => 'CRM_Event_DAO_Participant',
775 'table' => 'civicrm_participant',
776 ) ,
777 'CRM_Event_DAO_ParticipantPayment' => array(
778 'name' => 'ParticipantPayment',
779 'class' => 'CRM_Event_DAO_ParticipantPayment',
780 'table' => 'civicrm_participant_payment',
781 ) ,
782 'CRM_Event_Cart_DAO_EventInCart' => array(
783 'name' => 'EventInCart',
784 'class' => 'CRM_Event_Cart_DAO_EventInCart',
785 'table' => 'civicrm_events_in_carts',
786 ) ,
787 'CRM_Pledge_DAO_PledgePayment' => array(
788 'name' => 'PledgePayment',
789 'class' => 'CRM_Pledge_DAO_PledgePayment',
790 'table' => 'civicrm_pledge_payment',
791 ) ,
792 'CRM_Price_DAO_LineItem' => array(
793 'name' => 'LineItem',
794 'class' => 'CRM_Price_DAO_LineItem',
795 'table' => 'civicrm_line_item',
796 ) ,
797 );
798 CRM_Utils_Hook::entityTypes($entityTypes);
799 self::$entityTypes = array();
800 self::$tables = array();
801 self::$daoToClass = array();
802 foreach($entityTypes as $entityType) {
803 self::registerEntityType($entityType['name'], $entityType['class'], $entityType['table']);
804 }
805 $init = TRUE;
806 }
807 /**
808 * (Quasi-Private) Do not call externally (except for unit-testing)
809 */
810 static public function registerEntityType($daoName, $className, $tableName) {
811 self::$daoToClass[$daoName] = $className;
812 self::$tables[$tableName] = $className;
813 self::$entityTypes[$className] = array(
814 'name' => $daoName,
815 'class' => $className,
816 'table' => $tableName,
817 );
818 }
819 static public function get() {
820 self::init();
821 return self::$entityTypes;
822 }
823 static public function tables() {
824 self::init();
825 return self::$tables;
826 }
827 static public function daoToClass() {
828 self::init();
829 return self::$daoToClass;
830 }
831 static public function getCoreTables() {
832 return self::tables();
833 }
834 static public function isCoreTable($tableName) {
835 return FALSE !== array_search($tableName, self::tables());
836 }
837 static public function getCanonicalClassName($className) {
838 return str_replace('_BAO_', '_DAO_', $className);
839 }
840 static public function getClasses() {
841 return array_values(self::daoToClass());
842 }
843 static public function getClassForTable($tableName) {
844 return CRM_Utils_Array::value($tableName, self::tables());
845 }
846 static public function getFullName($daoName) {
847 return CRM_Utils_Array::value($daoName, self::daoToClass());
848 }
849 static public function getBriefName($className) {
850 return CRM_Utils_Array::value($className, array_flip(self::daoToClass()));
851 }
852 /**
853 * @param string $className DAO or BAO name
854 * @return string|FALSE SQL table name
855 */
856 static public function getTableForClass($className) {
857 return array_search(self::getCanonicalClassName($className) , self::tables());
858 }
859 static public function reinitializeCache($fresh = FALSE) {
860 self::init($fresh);
861 }
862 }