Regenerate DAO files to have 'where' fields defined
[civicrm-core.git] / CRM / Dedupe / DAO / Exception.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
6b83d5bd 5 * @copyright CiviCRM LLC (c) 2004-2019
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Dedupe/Exception.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
b23a2a3b 9 * (GenCodeChecksum:1f39e9ee1f80da1b62c054f6ca4119c5)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the Exception entity.
f41f0342 14 */
e501603b 15class 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 */
fa45b5b9 22 public 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 */
fa45b5b9 29 public static $_log = FALSE;
c3fc2621 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 67 if (!isset(Civi::$statics[__CLASS__]['links'])) {
fa45b5b9 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'),
215b423e 88 'description' => ts('Unique dedupe exception id'),
c3fc2621 89 'required' => TRUE,
a36434b9 90 'where' => 'civicrm_dedupe_exception.id',
522a26c9 91 'table_name' => 'civicrm_dedupe_exception',
92 'entity' => 'Exception',
93 'bao' => 'CRM_Dedupe_DAO_Exception',
6a7e5e5d 94 'localizable' => 0,
c3fc2621
CW
95 ],
96 'contact_id1' => [
e501603b
TO
97 'name' => 'contact_id1',
98 'type' => CRM_Utils_Type::T_INT,
c3fc2621 99 'title' => ts('First Dupe Contact ID'),
215b423e 100 'description' => ts('FK to Contact ID'),
b23a2a3b 101 'required' => TRUE,
a36434b9 102 'where' => 'civicrm_dedupe_exception.contact_id1',
522a26c9 103 'table_name' => 'civicrm_dedupe_exception',
104 'entity' => 'Exception',
105 'bao' => 'CRM_Dedupe_DAO_Exception',
6a7e5e5d 106 'localizable' => 0,
e501603b 107 'FKClassName' => 'CRM_Contact_DAO_Contact',
c3fc2621
CW
108 ],
109 'contact_id2' => [
e501603b
TO
110 'name' => 'contact_id2',
111 'type' => CRM_Utils_Type::T_INT,
c3fc2621 112 'title' => ts('Second Dupe Contact ID'),
215b423e 113 'description' => ts('FK to Contact ID'),
b23a2a3b 114 'required' => TRUE,
a36434b9 115 'where' => 'civicrm_dedupe_exception.contact_id2',
522a26c9 116 'table_name' => 'civicrm_dedupe_exception',
117 'entity' => 'Exception',
118 'bao' => 'CRM_Dedupe_DAO_Exception',
6a7e5e5d 119 'localizable' => 0,
e501603b 120 'FKClassName' => 'CRM_Contact_DAO_Contact',
c3fc2621
CW
121 ],
122 ];
346aaaba 123 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 124 }
346aaaba 125 return Civi::$statics[__CLASS__]['fields'];
e501603b 126 }
c3fc2621 127
e501603b 128 /**
bd8e0b14 129 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
130 *
131 * @return array
bd8e0b14 132 * Array(string $name => string $uniqueName).
e501603b 133 */
c3fc2621 134 public static function &fieldKeys() {
bd8e0b14
TO
135 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
136 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 137 }
bd8e0b14 138 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 139 }
c3fc2621 140
e501603b
TO
141 /**
142 * Returns the names of this table
143 *
144 * @return string
145 */
c3fc2621 146 public static function getTableName() {
e501603b
TO
147 return self::$_tableName;
148 }
c3fc2621 149
e501603b
TO
150 /**
151 * Returns if this table needs to be logged
152 *
c3fc2621 153 * @return bool
e501603b 154 */
c3fc2621 155 public function getLog() {
e501603b
TO
156 return self::$_log;
157 }
c3fc2621 158
e501603b
TO
159 /**
160 * Returns the list of fields that can be imported
161 *
162 * @param bool $prefix
163 *
164 * @return array
165 */
c3fc2621
CW
166 public static function &import($prefix = FALSE) {
167 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'dedupe_exception', $prefix, []);
60808919 168 return $r;
e501603b 169 }
c3fc2621 170
e501603b
TO
171 /**
172 * Returns the list of fields that can be exported
173 *
174 * @param bool $prefix
175 *
176 * @return array
177 */
c3fc2621
CW
178 public static function &export($prefix = FALSE) {
179 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'dedupe_exception', $prefix, []);
60808919 180 return $r;
e501603b 181 }
c3fc2621 182
e7a6b91a
AS
183 /**
184 * Returns the list of indices
c3fc2621
CW
185 *
186 * @param bool $localize
187 *
188 * @return array
e7a6b91a
AS
189 */
190 public static function indices($localize = TRUE) {
c3fc2621
CW
191 $indices = [
192 'UI_contact_id1_contact_id2' => [
e7a6b91a 193 'name' => 'UI_contact_id1_contact_id2',
c3fc2621 194 'field' => [
e7a6b91a
AS
195 0 => 'contact_id1',
196 1 => 'contact_id2',
c3fc2621
CW
197 ],
198 'localizable' => FALSE,
199 'unique' => TRUE,
e7a6b91a 200 'sig' => 'civicrm_dedupe_exception::1::contact_id1::contact_id2',
c3fc2621
CW
201 ],
202 ];
e7a6b91a
AS
203 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
204 }
c3fc2621 205
e501603b 206}