3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
31 * Generated from xml/schema/CRM/Core/Setting.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:cc5f4aca441eb6d874c637a53cabddd8)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_Setting
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_setting';
45 * static instance to hold the field values
49 static $_fields = null;
51 * static instance to hold the FK relationships
55 static $_links = null;
57 * static value to see if we should log any modifications to
58 * this table in the civicrm_log table
69 * Unique name for setting
75 * data associated with this group / name combo
81 * Which Domain is this menu item for
87 * FK to Contact ID if the setting is localized to a contact
93 * Is this setting a contact specific or site wide setting?
99 * Component that this menu item belongs to
103 public $component_id;
105 * When was the setting created
109 public $created_date;
111 * FK to civicrm_contact, who created this setting
119 * @return civicrm_setting
121 function __construct() {
122 $this->__table
= 'civicrm_setting';
123 parent
::__construct();
126 * Returns foreign keys and entity references
129 * [CRM_Core_Reference_Interface]
131 static function getReferenceColumns() {
132 if (!self
::$_links) {
133 self
::$_links = static ::createReferenceColumns(__CLASS__
);
134 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'domain_id', 'civicrm_domain', 'id');
135 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contact_id', 'civicrm_contact', 'id');
136 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'component_id', 'civicrm_component', 'id');
137 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'created_id', 'civicrm_contact', 'id');
139 return self
::$_links;
142 * Returns all the column names of this table
146 static function &fields() {
147 if (!(self
::$_fields)) {
148 self
::$_fields = array(
151 'type' => CRM_Utils_Type
::T_INT
,
152 'title' => ts('Setting ID') ,
157 'type' => CRM_Utils_Type
::T_STRING
,
158 'title' => ts('Setting Name') ,
159 'description' => 'Unique name for setting',
161 'size' => CRM_Utils_Type
::HUGE
,
165 'type' => CRM_Utils_Type
::T_TEXT
,
166 'title' => ts('Value') ,
167 'description' => 'data associated with this group / name combo',
169 'domain_id' => array(
170 'name' => 'domain_id',
171 'type' => CRM_Utils_Type
::T_INT
,
172 'title' => ts('Setting Domain') ,
173 'description' => 'Which Domain is this menu item for',
175 'FKClassName' => 'CRM_Core_DAO_Domain',
176 'pseudoconstant' => array(
177 'table' => 'civicrm_domain',
179 'labelColumn' => 'name',
182 'contact_id' => array(
183 'name' => 'contact_id',
184 'type' => CRM_Utils_Type
::T_INT
,
185 'title' => ts('Setting Contact') ,
186 'description' => 'FK to Contact ID if the setting is localized to a contact',
187 'FKClassName' => 'CRM_Contact_DAO_Contact',
189 'is_domain' => array(
190 'name' => 'is_domain',
191 'type' => CRM_Utils_Type
::T_BOOLEAN
,
192 'title' => ts('Is Domain Setting?') ,
193 'description' => 'Is this setting a contact specific or site wide setting?',
195 'component_id' => array(
196 'name' => 'component_id',
197 'type' => CRM_Utils_Type
::T_INT
,
198 'title' => ts('Setting Component') ,
199 'description' => 'Component that this menu item belongs to',
200 'FKClassName' => 'CRM_Core_DAO_Component',
204 'pseudoconstant' => array(
205 'table' => 'civicrm_component',
207 'labelColumn' => 'name',
210 'created_date' => array(
211 'name' => 'created_date',
212 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
213 'title' => ts('Setting Created Date') ,
214 'description' => 'When was the setting created',
216 'created_id' => array(
217 'name' => 'created_id',
218 'type' => CRM_Utils_Type
::T_INT
,
219 'title' => ts('Setting Created By') ,
220 'description' => 'FK to civicrm_contact, who created this setting',
221 'FKClassName' => 'CRM_Contact_DAO_Contact',
225 return self
::$_fields;
228 * Return a mapping from field-name to the corresponding key (as used in fields()).
231 * Array(string $name => string $uniqueName).
233 static function &fieldKeys() {
234 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
235 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
237 return Civi
::$statics[__CLASS__
]['fieldKeys'];
240 * Returns the names of this table
244 static function getTableName() {
245 return self
::$_tableName;
248 * Returns if this table needs to be logged
256 * Returns the list of fields that can be imported
258 * @param bool $prefix
262 static function &import($prefix = false) {
263 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'setting', $prefix, array());
267 * Returns the list of fields that can be exported
269 * @param bool $prefix
273 static function &export($prefix = false) {
274 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'setting', $prefix, array());