Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
0f03f337 | 5 | * @copyright CiviCRM LLC (c) 2004-2017 |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Dedupe/Exception.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
e7a6b91a | 9 | * (GenCodeChecksum:5e9f138ebec5aa2fcfd30120dffacdf5) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the Exception entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Dedupe_DAO_Exception extends CRM_Core_DAO { |
c3fc2621 | 16 | |
e501603b | 17 | /** |
f41f0342 | 18 | * Static instance to hold the table name. |
e501603b TO |
19 | * |
20 | * @var string | |
21 | */ | |
22 | static $_tableName = 'civicrm_dedupe_exception'; | |
c3fc2621 | 23 | |
e501603b | 24 | /** |
f41f0342 | 25 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 26 | * |
c3fc2621 | 27 | * @var bool |
e501603b | 28 | */ |
c3fc2621 CW |
29 | static $_log = FALSE; |
30 | ||
e501603b TO |
31 | /** |
32 | * Unique dedupe exception id | |
33 | * | |
34 | * @var int unsigned | |
35 | */ | |
36 | public $id; | |
c3fc2621 | 37 | |
e501603b TO |
38 | /** |
39 | * FK to Contact ID | |
40 | * | |
41 | * @var int unsigned | |
42 | */ | |
43 | public $contact_id1; | |
c3fc2621 | 44 | |
e501603b TO |
45 | /** |
46 | * FK to Contact ID | |
47 | * | |
48 | * @var int unsigned | |
49 | */ | |
50 | public $contact_id2; | |
c3fc2621 | 51 | |
e501603b | 52 | /** |
f41f0342 | 53 | * Class constructor. |
e501603b | 54 | */ |
c3fc2621 | 55 | public function __construct() { |
e501603b TO |
56 | $this->__table = 'civicrm_dedupe_exception'; |
57 | parent::__construct(); | |
58 | } | |
c3fc2621 | 59 | |
e501603b | 60 | /** |
f41f0342 | 61 | * Returns foreign keys and entity references. |
e501603b TO |
62 | * |
63 | * @return array | |
64 | * [CRM_Core_Reference_Interface] | |
65 | */ | |
c3fc2621 | 66 | public static function getReferenceColumns() { |
346aaaba TO |
67 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
68 | Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__); | |
c3fc2621 CW |
69 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id1', 'civicrm_contact', 'id'); |
70 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id2', 'civicrm_contact', 'id'); | |
346aaaba | 71 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 72 | } |
346aaaba | 73 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 74 | } |
c3fc2621 | 75 | |
e501603b TO |
76 | /** |
77 | * Returns all the column names of this table | |
78 | * | |
79 | * @return array | |
80 | */ | |
c3fc2621 | 81 | public static function &fields() { |
346aaaba | 82 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
83 | Civi::$statics[__CLASS__]['fields'] = [ |
84 | 'id' => [ | |
e501603b TO |
85 | 'name' => 'id', |
86 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 87 | 'title' => ts('Dedupe Exception ID'), |
e501603b | 88 | 'description' => 'Unique dedupe exception id', |
c3fc2621 | 89 | 'required' => TRUE, |
522a26c9 | 90 | 'table_name' => 'civicrm_dedupe_exception', |
91 | 'entity' => 'Exception', | |
92 | 'bao' => 'CRM_Dedupe_DAO_Exception', | |
6a7e5e5d | 93 | 'localizable' => 0, |
c3fc2621 CW |
94 | ], |
95 | 'contact_id1' => [ | |
e501603b TO |
96 | 'name' => 'contact_id1', |
97 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 98 | 'title' => ts('First Dupe Contact ID'), |
e501603b | 99 | 'description' => 'FK to Contact ID', |
522a26c9 | 100 | 'table_name' => 'civicrm_dedupe_exception', |
101 | 'entity' => 'Exception', | |
102 | 'bao' => 'CRM_Dedupe_DAO_Exception', | |
6a7e5e5d | 103 | 'localizable' => 0, |
e501603b | 104 | 'FKClassName' => 'CRM_Contact_DAO_Contact', |
c3fc2621 CW |
105 | ], |
106 | 'contact_id2' => [ | |
e501603b TO |
107 | 'name' => 'contact_id2', |
108 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 109 | 'title' => ts('Second Dupe Contact ID'), |
e501603b | 110 | 'description' => 'FK to Contact ID', |
522a26c9 | 111 | 'table_name' => 'civicrm_dedupe_exception', |
112 | 'entity' => 'Exception', | |
113 | 'bao' => 'CRM_Dedupe_DAO_Exception', | |
6a7e5e5d | 114 | 'localizable' => 0, |
e501603b | 115 | 'FKClassName' => 'CRM_Contact_DAO_Contact', |
c3fc2621 CW |
116 | ], |
117 | ]; | |
346aaaba | 118 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 119 | } |
346aaaba | 120 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 121 | } |
c3fc2621 | 122 | |
e501603b | 123 | /** |
bd8e0b14 | 124 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
125 | * |
126 | * @return array | |
bd8e0b14 | 127 | * Array(string $name => string $uniqueName). |
e501603b | 128 | */ |
c3fc2621 | 129 | public static function &fieldKeys() { |
bd8e0b14 TO |
130 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
131 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 132 | } |
bd8e0b14 | 133 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 134 | } |
c3fc2621 | 135 | |
e501603b TO |
136 | /** |
137 | * Returns the names of this table | |
138 | * | |
139 | * @return string | |
140 | */ | |
c3fc2621 | 141 | public static function getTableName() { |
e501603b TO |
142 | return self::$_tableName; |
143 | } | |
c3fc2621 | 144 | |
e501603b TO |
145 | /** |
146 | * Returns if this table needs to be logged | |
147 | * | |
c3fc2621 | 148 | * @return bool |
e501603b | 149 | */ |
c3fc2621 | 150 | public function getLog() { |
e501603b TO |
151 | return self::$_log; |
152 | } | |
c3fc2621 | 153 | |
e501603b TO |
154 | /** |
155 | * Returns the list of fields that can be imported | |
156 | * | |
157 | * @param bool $prefix | |
158 | * | |
159 | * @return array | |
160 | */ | |
c3fc2621 CW |
161 | public static function &import($prefix = FALSE) { |
162 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'dedupe_exception', $prefix, []); | |
60808919 | 163 | return $r; |
e501603b | 164 | } |
c3fc2621 | 165 | |
e501603b TO |
166 | /** |
167 | * Returns the list of fields that can be exported | |
168 | * | |
169 | * @param bool $prefix | |
170 | * | |
171 | * @return array | |
172 | */ | |
c3fc2621 CW |
173 | public static function &export($prefix = FALSE) { |
174 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'dedupe_exception', $prefix, []); | |
60808919 | 175 | return $r; |
e501603b | 176 | } |
c3fc2621 | 177 | |
e7a6b91a AS |
178 | /** |
179 | * Returns the list of indices | |
c3fc2621 CW |
180 | * |
181 | * @param bool $localize | |
182 | * | |
183 | * @return array | |
e7a6b91a AS |
184 | */ |
185 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
186 | $indices = [ |
187 | 'UI_contact_id1_contact_id2' => [ | |
e7a6b91a | 188 | 'name' => 'UI_contact_id1_contact_id2', |
c3fc2621 | 189 | 'field' => [ |
e7a6b91a AS |
190 | 0 => 'contact_id1', |
191 | 1 => 'contact_id2', | |
c3fc2621 CW |
192 | ], |
193 | 'localizable' => FALSE, | |
194 | 'unique' => TRUE, | |
e7a6b91a | 195 | 'sig' => 'civicrm_dedupe_exception::1::contact_id1::contact_id2', |
c3fc2621 CW |
196 | ], |
197 | ]; | |
e7a6b91a AS |
198 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
199 | } | |
c3fc2621 | 200 | |
e501603b | 201 | } |