Merge pull request #4939 from colemanw/CRM-15789
[civicrm-core.git] / CRM / Core / TableHierarchy.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2014 |
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 * Class representing the table relationships
30 *
31 * @package CRM
32 * @copyright CiviCRM LLC (c) 2004-2014
33 * $Id$
34 *
35 */
36 class CRM_Core_TableHierarchy {
37
38 /**
39 * This array defines weights for table, which are used to sort array of table in from clause
40 * @var array
41 */
42 static $info = array(
43 'civicrm_contact' => '01',
44 'civicrm_address' => '09',
45 'civicrm_county' => '10',
46 'civicrm_state_province' => '11',
47 'civicrm_country' => '12',
48 'civicrm_email' => '13',
49 'civicrm_phone' => '14',
50 'civicrm_im' => '15',
51 'civicrm_openid' => '17',
52 'civicrm_location_type' => '18',
53 'civicrm_group_contact' => '19',
54 'civicrm_group' => '20',
55 'civicrm_subscription_history' => '21',
56 'civicrm_entity_tag' => '22',
57 'civicrm_note' => '23',
58 'civicrm_contribution' => '24',
59 'civicrm_financial_type' => '25',
60 'civicrm_participant' => '26',
61 'civicrm_event' => '27',
62 'civicrm_worldregion' => '28',
63 'civicrm_case_contact' => '29',
64 'civicrm_case' => '30',
65 'case_relationship' => '31',
66 'case_relation_type' => '32',
67 'civicrm_activity' => '33',
68 'civicrm_mailing_summary' => '34',
69 'civicrm_mailing_recipients' => '35',
70 'civicrm_mailing' => '36',
71 'civicrm_mailing_job' => '37',
72 'civicrm_mailing_event_queue' => '38',
73 'civicrm_mailing_event_bounce' => '39',
74 'civicrm_mailing_event_opened' => '40',
75 'civicrm_mailing_event_reply' => '41',
76 'civicrm_mailing_event_trackable_url_open' => '42',
77 );
78
79 /**
80 * @return array
81 */
82 public static function &info() {
83 //get the campaign related tables.
84 CRM_Campaign_BAO_Query::info(self::$info);
85
86 return self::$info;
87 }
88 }