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:03045a230d0ba9aa60bf9dd4818cb12e)
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',
149 'type' => CRM_Utils_Type
::T_STRING
,
150 'title' => ts('Setting Name') ,
151 'description' => 'Unique name for setting',
153 'size' => CRM_Utils_Type
::HUGE
,
154 'table_name' => 'civicrm_setting',
155 'entity' => 'Setting',
156 'bao' => 'CRM_Core_BAO_Setting',
160 'type' => CRM_Utils_Type
::T_TEXT
,
161 'title' => ts('Value') ,
162 'description' => 'data associated with this group / name combo',
163 'table_name' => 'civicrm_setting',
164 'entity' => 'Setting',
165 'bao' => 'CRM_Core_BAO_Setting',
167 'domain_id' => array(
168 'name' => 'domain_id',
169 'type' => CRM_Utils_Type
::T_INT
,
170 'title' => ts('Setting Domain') ,
171 'description' => 'Which Domain is this menu item for',
173 'table_name' => 'civicrm_setting',
174 'entity' => 'Setting',
175 'bao' => 'CRM_Core_BAO_Setting',
176 'FKClassName' => 'CRM_Core_DAO_Domain',
177 'pseudoconstant' => array(
178 'table' => 'civicrm_domain',
180 'labelColumn' => 'name',
183 'contact_id' => array(
184 'name' => 'contact_id',
185 'type' => CRM_Utils_Type
::T_INT
,
186 'title' => ts('Setting Contact') ,
187 'description' => 'FK to Contact ID if the setting is localized to a contact',
188 'table_name' => 'civicrm_setting',
189 'entity' => 'Setting',
190 'bao' => 'CRM_Core_BAO_Setting',
191 'FKClassName' => 'CRM_Contact_DAO_Contact',
193 'is_domain' => array(
194 'name' => 'is_domain',
195 'type' => CRM_Utils_Type
::T_BOOLEAN
,
196 'title' => ts('Is Domain Setting?') ,
197 'description' => 'Is this setting a contact specific or site wide setting?',
198 'table_name' => 'civicrm_setting',
199 'entity' => 'Setting',
200 'bao' => 'CRM_Core_BAO_Setting',
202 'component_id' => array(
203 'name' => 'component_id',
204 'type' => CRM_Utils_Type
::T_INT
,
205 'title' => ts('Setting Component') ,
206 'description' => 'Component that this menu item belongs to',
207 'table_name' => 'civicrm_setting',
208 'entity' => 'Setting',
209 'bao' => 'CRM_Core_BAO_Setting',
210 'FKClassName' => 'CRM_Core_DAO_Component',
214 'pseudoconstant' => array(
215 'table' => 'civicrm_component',
217 'labelColumn' => 'name',
220 'created_date' => array(
221 'name' => 'created_date',
222 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
223 'title' => ts('Setting Created Date') ,
224 'description' => 'When was the setting created',
225 'table_name' => 'civicrm_setting',
226 'entity' => 'Setting',
227 'bao' => 'CRM_Core_BAO_Setting',
229 'created_id' => array(
230 'name' => 'created_id',
231 'type' => CRM_Utils_Type
::T_INT
,
232 'title' => ts('Setting Created By') ,
233 'description' => 'FK to civicrm_contact, who created this setting',
234 'table_name' => 'civicrm_setting',
235 'entity' => 'Setting',
236 'bao' => 'CRM_Core_BAO_Setting',
237 'FKClassName' => 'CRM_Contact_DAO_Contact',
240 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
242 return Civi
::$statics[__CLASS__
]['fields'];
245 * Return a mapping from field-name to the corresponding key (as used in fields()).
248 * Array(string $name => string $uniqueName).
250 static function &fieldKeys() {
251 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
252 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
254 return Civi
::$statics[__CLASS__
]['fieldKeys'];
257 * Returns the names of this table
261 static function getTableName() {
262 return self
::$_tableName;
265 * Returns if this table needs to be logged
273 * Returns the list of fields that can be imported
275 * @param bool $prefix
279 static function &import($prefix = false) {
280 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'setting', $prefix, array());
284 * Returns the list of fields that can be exported
286 * @param bool $prefix
290 static function &export($prefix = false) {
291 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'setting', $prefix, array());