| 1 | <?php |
| 2 | /* |
| 3 | +--------------------------------------------------------------------+ |
| 4 | | CiviCRM version 5 | |
| 5 | +--------------------------------------------------------------------+ |
| 6 | | Copyright CiviCRM LLC (c) 2004-2019 | |
| 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-2019 |
| 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 | public static $info = [ |
| 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_contact_cache' => '20', |
| 55 | 'civicrm_group' => '21', |
| 56 | 'civicrm_subscription_history' => '22', |
| 57 | 'civicrm_entity_tag' => '23', |
| 58 | 'civicrm_note' => '24', |
| 59 | 'civicrm_contribution' => '25', |
| 60 | 'civicrm_financial_type' => '26', |
| 61 | 'civicrm_participant' => '27', |
| 62 | 'civicrm_event' => '28', |
| 63 | 'civicrm_worldregion' => '29', |
| 64 | 'civicrm_case_contact' => '30', |
| 65 | 'civicrm_case' => '31', |
| 66 | 'case_relationship' => '32', |
| 67 | 'case_relation_type' => '33', |
| 68 | 'civicrm_activity' => '34', |
| 69 | 'civicrm_mailing_summary' => '35', |
| 70 | 'civicrm_mailing_recipients' => '36', |
| 71 | 'civicrm_mailing' => '37', |
| 72 | 'civicrm_mailing_job' => '38', |
| 73 | 'civicrm_mailing_event_queue' => '39', |
| 74 | 'civicrm_mailing_event_bounce' => '40', |
| 75 | 'civicrm_mailing_event_opened' => '41', |
| 76 | 'civicrm_mailing_event_reply' => '42', |
| 77 | 'civicrm_mailing_event_trackable_url_open' => '43', |
| 78 | ]; |
| 79 | |
| 80 | /** |
| 81 | * @return array |
| 82 | */ |
| 83 | public static function &info() { |
| 84 | //get the campaign related tables. |
| 85 | CRM_Campaign_BAO_Query::info(self::$info); |
| 86 | |
| 87 | return self::$info; |
| 88 | } |
| 89 | |
| 90 | } |