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 keys used in $_fields for each field.
55 static $_fieldKeys = null;
57 * static instance to hold the FK relationships
61 static $_links = null;
63 * static instance to hold the values that can
68 static $_import = null;
70 * static instance to hold the values that can
75 static $_export = null;
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
89 * Unique name for setting
95 * data associated with this group / name combo
101 * Which Domain is this menu item for
107 * FK to Contact ID if the setting is localized to a contact
113 * Is this setting a contact specific or site wide setting?
119 * Component that this menu item belongs to
123 public $component_id;
125 * When was the setting created
129 public $created_date;
131 * FK to civicrm_contact, who created this setting
139 * @return civicrm_setting
141 function __construct() {
142 $this->__table
= 'civicrm_setting';
143 parent
::__construct();
146 * Returns foreign keys and entity references
149 * [CRM_Core_Reference_Interface]
151 static function getReferenceColumns() {
152 if (!self
::$_links) {
153 self
::$_links = static ::createReferenceColumns(__CLASS__
);
154 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'domain_id', 'civicrm_domain', 'id');
155 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contact_id', 'civicrm_contact', 'id');
156 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'component_id', 'civicrm_component', 'id');
157 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'created_id', 'civicrm_contact', 'id');
159 return self
::$_links;
162 * Returns all the column names of this table
166 static function &fields() {
167 if (!(self
::$_fields)) {
168 self
::$_fields = array(
171 'type' => CRM_Utils_Type
::T_INT
,
172 'title' => ts('Setting ID') ,
177 'type' => CRM_Utils_Type
::T_STRING
,
178 'title' => ts('Setting Name') ,
179 'description' => 'Unique name for setting',
181 'size' => CRM_Utils_Type
::HUGE
,
185 'type' => CRM_Utils_Type
::T_TEXT
,
186 'title' => ts('Value') ,
187 'description' => 'data associated with this group / name combo',
189 'domain_id' => array(
190 'name' => 'domain_id',
191 'type' => CRM_Utils_Type
::T_INT
,
192 'title' => ts('Setting Domain') ,
193 'description' => 'Which Domain is this menu item for',
195 'FKClassName' => 'CRM_Core_DAO_Domain',
196 'pseudoconstant' => array(
197 'table' => 'civicrm_domain',
199 'labelColumn' => 'name',
202 'contact_id' => array(
203 'name' => 'contact_id',
204 'type' => CRM_Utils_Type
::T_INT
,
205 'title' => ts('Setting Contact') ,
206 'description' => 'FK to Contact ID if the setting is localized to a contact',
207 'FKClassName' => 'CRM_Contact_DAO_Contact',
209 'is_domain' => array(
210 'name' => 'is_domain',
211 'type' => CRM_Utils_Type
::T_BOOLEAN
,
212 'title' => ts('Is Domain Setting?') ,
213 'description' => 'Is this setting a contact specific or site wide setting?',
215 'component_id' => array(
216 'name' => 'component_id',
217 'type' => CRM_Utils_Type
::T_INT
,
218 'title' => ts('Setting Component') ,
219 'description' => 'Component that this menu item belongs to',
220 'FKClassName' => 'CRM_Core_DAO_Component',
224 'pseudoconstant' => array(
225 'table' => 'civicrm_component',
227 'labelColumn' => 'name',
230 'created_date' => array(
231 'name' => 'created_date',
232 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
233 'title' => ts('Setting Created Date') ,
234 'description' => 'When was the setting created',
236 'created_id' => array(
237 'name' => 'created_id',
238 'type' => CRM_Utils_Type
::T_INT
,
239 'title' => ts('Setting Created By') ,
240 'description' => 'FK to civicrm_contact, who created this setting',
241 'FKClassName' => 'CRM_Contact_DAO_Contact',
245 return self
::$_fields;
248 * Returns an array containing, for each field, the arary key used for that
249 * field in self::$_fields.
253 static function &fieldKeys() {
254 if (!(self
::$_fieldKeys)) {
255 self
::$_fieldKeys = array(
259 'domain_id' => 'domain_id',
260 'contact_id' => 'contact_id',
261 'is_domain' => 'is_domain',
262 'component_id' => 'component_id',
263 'created_date' => 'created_date',
264 'created_id' => 'created_id',
267 return self
::$_fieldKeys;
270 * Returns the names of this table
274 static function getTableName() {
275 return self
::$_tableName;
278 * Returns if this table needs to be logged
286 * Returns the list of fields that can be imported
288 * @param bool $prefix
292 static function &import($prefix = false) {
293 if (!(self
::$_import)) {
294 self
::$_import = array();
295 $fields = self
::fields();
296 foreach($fields as $name => $field) {
297 if (CRM_Utils_Array
::value('import', $field)) {
299 self
::$_import['setting'] = & $fields[$name];
301 self
::$_import[$name] = & $fields[$name];
306 return self
::$_import;
309 * Returns the list of fields that can be exported
311 * @param bool $prefix
315 static function &export($prefix = false) {
316 if (!(self
::$_export)) {
317 self
::$_export = array();
318 $fields = self
::fields();
319 foreach($fields as $name => $field) {
320 if (CRM_Utils_Array
::value('export', $field)) {
322 self
::$_export['setting'] = & $fields[$name];
324 self
::$_export[$name] = & $fields[$name];
329 return self
::$_export;