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/Core/Setting.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:a9b0b7aaf6ae42696ce402c1ff9acb89)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Core_DAO_Setting constructor.
40 class CRM_Core_DAO_Setting
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_setting';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
59 * Unique name for setting
65 * data associated with this group / name combo
71 * Which Domain is this menu item for
77 * FK to Contact ID if the setting is localized to a contact
83 * Is this setting a contact specific or site wide setting?
89 * Component that this menu item belongs to
95 * When was the setting created
101 * FK to civicrm_contact, who created this setting
109 function __construct() {
110 $this->__table
= 'civicrm_setting';
111 parent
::__construct();
114 * Returns foreign keys and entity references.
117 * [CRM_Core_Reference_Interface]
119 static function getReferenceColumns() {
120 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
121 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
122 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'domain_id', 'civicrm_domain', 'id');
123 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contact_id', 'civicrm_contact', 'id');
124 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'component_id', 'civicrm_component', 'id');
125 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'created_id', 'civicrm_contact', 'id');
126 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
128 return Civi
::$statics[__CLASS__
]['links'];
131 * Returns all the column names of this table
135 static function &fields() {
136 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
137 Civi
::$statics[__CLASS__
]['fields'] = array(
140 'type' => CRM_Utils_Type
::T_INT
,
141 'title' => ts('Setting ID') ,
143 'table_name' => 'civicrm_setting',
144 'entity' => 'Setting',
145 'bao' => 'CRM_Core_BAO_Setting',
150 'type' => CRM_Utils_Type
::T_STRING
,
151 'title' => ts('Setting Name') ,
152 'description' => 'Unique name for setting',
154 'size' => CRM_Utils_Type
::HUGE
,
155 'table_name' => 'civicrm_setting',
156 'entity' => 'Setting',
157 'bao' => 'CRM_Core_BAO_Setting',
162 'type' => CRM_Utils_Type
::T_TEXT
,
163 'title' => ts('Value') ,
164 'description' => 'data associated with this group / name combo',
165 'table_name' => 'civicrm_setting',
166 'entity' => 'Setting',
167 'bao' => 'CRM_Core_BAO_Setting',
170 'domain_id' => array(
171 'name' => 'domain_id',
172 'type' => CRM_Utils_Type
::T_INT
,
173 'title' => ts('Setting Domain') ,
174 'description' => 'Which Domain is this menu item for',
176 'table_name' => 'civicrm_setting',
177 'entity' => 'Setting',
178 'bao' => 'CRM_Core_BAO_Setting',
180 'FKClassName' => 'CRM_Core_DAO_Domain',
181 'pseudoconstant' => array(
182 'table' => 'civicrm_domain',
184 'labelColumn' => 'name',
187 'contact_id' => array(
188 'name' => 'contact_id',
189 'type' => CRM_Utils_Type
::T_INT
,
190 'title' => ts('Setting Contact') ,
191 'description' => 'FK to Contact ID if the setting is localized to a contact',
192 'table_name' => 'civicrm_setting',
193 'entity' => 'Setting',
194 'bao' => 'CRM_Core_BAO_Setting',
196 'FKClassName' => 'CRM_Contact_DAO_Contact',
198 'is_domain' => array(
199 'name' => 'is_domain',
200 'type' => CRM_Utils_Type
::T_BOOLEAN
,
201 'title' => ts('Is Domain Setting?') ,
202 'description' => 'Is this setting a contact specific or site wide setting?',
203 'table_name' => 'civicrm_setting',
204 'entity' => 'Setting',
205 'bao' => 'CRM_Core_BAO_Setting',
208 'component_id' => array(
209 'name' => 'component_id',
210 'type' => CRM_Utils_Type
::T_INT
,
211 'title' => ts('Setting Component') ,
212 'description' => 'Component that this menu item belongs to',
213 'table_name' => 'civicrm_setting',
214 'entity' => 'Setting',
215 'bao' => 'CRM_Core_BAO_Setting',
217 'FKClassName' => 'CRM_Core_DAO_Component',
221 'pseudoconstant' => array(
222 'table' => 'civicrm_component',
224 'labelColumn' => 'name',
227 'created_date' => array(
228 'name' => 'created_date',
229 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
230 'title' => ts('Setting Created Date') ,
231 'description' => 'When was the setting created',
232 'table_name' => 'civicrm_setting',
233 'entity' => 'Setting',
234 'bao' => 'CRM_Core_BAO_Setting',
237 'created_id' => array(
238 'name' => 'created_id',
239 'type' => CRM_Utils_Type
::T_INT
,
240 'title' => ts('Setting Created By') ,
241 'description' => 'FK to civicrm_contact, who created this setting',
242 'table_name' => 'civicrm_setting',
243 'entity' => 'Setting',
244 'bao' => 'CRM_Core_BAO_Setting',
246 'FKClassName' => 'CRM_Contact_DAO_Contact',
249 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
251 return Civi
::$statics[__CLASS__
]['fields'];
254 * Return a mapping from field-name to the corresponding key (as used in fields()).
257 * Array(string $name => string $uniqueName).
259 static function &fieldKeys() {
260 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
261 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
263 return Civi
::$statics[__CLASS__
]['fieldKeys'];
266 * Returns the names of this table
270 static function getTableName() {
271 return self
::$_tableName;
274 * Returns if this table needs to be logged
282 * Returns the list of fields that can be imported
284 * @param bool $prefix
288 static function &import($prefix = false) {
289 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'setting', $prefix, array());
293 * Returns the list of fields that can be exported
295 * @param bool $prefix
299 static function &export($prefix = false) {
300 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'setting', $prefix, array());
304 * Returns the list of indices
306 public static function indices($localize = TRUE) {
308 'index_domain_contact_name' => array(
309 'name' => 'index_domain_contact_name',
315 'localizable' => false,
317 'sig' => 'civicrm_setting::1::domain_id::contact_id::name',
320 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;