3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Dedupe/RuleGroup.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:025711212afbee5275704d4a7e63868f)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Dedupe_DAO_RuleGroup constructor.
40 class CRM_Dedupe_DAO_RuleGroup
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_dedupe_rule_group';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
54 * Unique dedupe rule group id
60 * The type of contacts this group applies to
66 * The weight threshold the sum of the rule weights has to cross to consider two contacts the same
72 * Whether the rule should be used for cases where usage is Unsupervised, Supervised OR General(programatically)
78 * Name of the rule group
84 * Label of the rule group
90 * Is this a reserved rule - a rule group that has been optimized and cannot be changed by the admin
98 function __construct() {
99 $this->__table
= 'civicrm_dedupe_rule_group';
100 parent
::__construct();
103 * Returns all the column names of this table
107 static function &fields() {
108 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
109 Civi
::$statics[__CLASS__
]['fields'] = array(
112 'type' => CRM_Utils_Type
::T_INT
,
113 'title' => ts('Rule Group ID') ,
114 'description' => 'Unique dedupe rule group id',
116 'table_name' => 'civicrm_dedupe_rule_group',
117 'entity' => 'RuleGroup',
118 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
120 'contact_type' => array(
121 'name' => 'contact_type',
122 'type' => CRM_Utils_Type
::T_STRING
,
123 'title' => ts('Contact Type') ,
124 'description' => 'The type of contacts this group applies to',
126 'size' => CRM_Utils_Type
::TWELVE
,
127 'table_name' => 'civicrm_dedupe_rule_group',
128 'entity' => 'RuleGroup',
129 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
133 'pseudoconstant' => array(
134 'table' => 'civicrm_contact_type',
135 'keyColumn' => 'name',
136 'labelColumn' => 'label',
137 'condition' => 'parent_id IS NULL',
140 'threshold' => array(
141 'name' => 'threshold',
142 'type' => CRM_Utils_Type
::T_INT
,
143 'title' => ts('Threshold') ,
144 'description' => 'The weight threshold the sum of the rule weights has to cross to consider two contacts the same',
146 'table_name' => 'civicrm_dedupe_rule_group',
147 'entity' => 'RuleGroup',
148 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
155 'type' => CRM_Utils_Type
::T_STRING
,
156 'title' => ts('Length') ,
157 'description' => 'Whether the rule should be used for cases where usage is Unsupervised, Supervised OR General(programatically)',
160 'size' => CRM_Utils_Type
::TWELVE
,
161 'table_name' => 'civicrm_dedupe_rule_group',
162 'entity' => 'RuleGroup',
163 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
167 'pseudoconstant' => array(
168 'callback' => 'CRM_Core_SelectValues::getDedupeRuleTypes',
173 'type' => CRM_Utils_Type
::T_STRING
,
174 'title' => ts('Name') ,
175 'description' => 'Name of the rule group',
177 'size' => CRM_Utils_Type
::BIG
,
178 'table_name' => 'civicrm_dedupe_rule_group',
179 'entity' => 'RuleGroup',
180 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
184 'type' => CRM_Utils_Type
::T_STRING
,
185 'title' => ts('Title') ,
186 'description' => 'Label of the rule group',
188 'size' => CRM_Utils_Type
::HUGE
,
189 'table_name' => 'civicrm_dedupe_rule_group',
190 'entity' => 'RuleGroup',
191 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
196 'is_reserved' => array(
197 'name' => 'is_reserved',
198 'type' => CRM_Utils_Type
::T_BOOLEAN
,
199 'title' => ts('Reserved?') ,
200 'description' => 'Is this a reserved rule - a rule group that has been optimized and cannot be changed by the admin',
201 'table_name' => 'civicrm_dedupe_rule_group',
202 'entity' => 'RuleGroup',
203 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
205 'type' => 'CheckBox',
209 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
211 return Civi
::$statics[__CLASS__
]['fields'];
214 * Return a mapping from field-name to the corresponding key (as used in fields()).
217 * Array(string $name => string $uniqueName).
219 static function &fieldKeys() {
220 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
221 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
223 return Civi
::$statics[__CLASS__
]['fieldKeys'];
226 * Returns the names of this table
230 static function getTableName() {
231 return self
::$_tableName;
234 * Returns if this table needs to be logged
242 * Returns the list of fields that can be imported
244 * @param bool $prefix
248 static function &import($prefix = false) {
249 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dedupe_rule_group', $prefix, array());
253 * Returns the list of fields that can be exported
255 * @param bool $prefix
259 static function &export($prefix = false) {
260 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dedupe_rule_group', $prefix, array());