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/OptionGroup.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:3fc50ba774dcb073e5ab1a2e84bf880f)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_OptionGroup
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_option_group';
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
90 * Option group name. Used as selection key by class properties which lookup options in civicrm_option_value.
102 * Option group description.
108 * Is this a predefined system option group (i.e. it can not be deleted)?
114 * Is this option group active?
120 * A lock to remove the ability to add new options via the UI.
128 * @return civicrm_option_group
130 function __construct() {
131 $this->__table
= 'civicrm_option_group';
132 parent
::__construct();
135 * Returns all the column names of this table
139 static function &fields() {
140 if (!(self
::$_fields)) {
141 self
::$_fields = array(
144 'type' => CRM_Utils_Type
::T_INT
,
145 'title' => ts('Option Group ID') ,
146 'description' => 'Option Group ID',
151 'type' => CRM_Utils_Type
::T_STRING
,
152 'title' => ts('Option Group Name') ,
153 'description' => 'Option group name. Used as selection key by class properties which lookup options in civicrm_option_value.',
156 'size' => CRM_Utils_Type
::BIG
,
160 'type' => CRM_Utils_Type
::T_STRING
,
161 'title' => ts('Option Group title') ,
162 'description' => 'Option Group title.',
164 'size' => CRM_Utils_Type
::HUGE
,
166 'description' => array(
167 'name' => 'description',
168 'type' => CRM_Utils_Type
::T_STRING
,
169 'title' => ts('Option Group Description') ,
170 'description' => 'Option group description.',
172 'size' => CRM_Utils_Type
::HUGE
,
174 'is_reserved' => array(
175 'name' => 'is_reserved',
176 'type' => CRM_Utils_Type
::T_BOOLEAN
,
177 'title' => ts('Option Group Is Reserved?') ,
178 'description' => 'Is this a predefined system option group (i.e. it can not be deleted)?',
181 'is_active' => array(
182 'name' => 'is_active',
183 'type' => CRM_Utils_Type
::T_BOOLEAN
,
184 'title' => ts('Option Group Is Active?') ,
185 'description' => 'Is this option group active?',
187 'is_locked' => array(
188 'name' => 'is_locked',
189 'type' => CRM_Utils_Type
::T_BOOLEAN
,
190 'title' => ts('Option Group Is Locked') ,
191 'description' => 'A lock to remove the ability to add new options via the UI.',
195 return self
::$_fields;
198 * Returns an array containing, for each field, the arary key used for that
199 * field in self::$_fields.
203 static function &fieldKeys() {
204 if (!(self
::$_fieldKeys)) {
205 self
::$_fieldKeys = array(
209 'description' => 'description',
210 'is_reserved' => 'is_reserved',
211 'is_active' => 'is_active',
212 'is_locked' => 'is_locked',
215 return self
::$_fieldKeys;
218 * Returns the names of this table
222 static function getTableName() {
223 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
226 * Returns if this table needs to be logged
234 * Returns the list of fields that can be imported
236 * @param bool $prefix
240 static function &import($prefix = false) {
241 if (!(self
::$_import)) {
242 self
::$_import = array();
243 $fields = self
::fields();
244 foreach($fields as $name => $field) {
245 if (CRM_Utils_Array
::value('import', $field)) {
247 self
::$_import['option_group'] = & $fields[$name];
249 self
::$_import[$name] = & $fields[$name];
254 return self
::$_import;
257 * Returns the list of fields that can be exported
259 * @param bool $prefix
263 static function &export($prefix = false) {
264 if (!(self
::$_export)) {
265 self
::$_export = array();
266 $fields = self
::fields();
267 foreach($fields as $name => $field) {
268 if (CRM_Utils_Array
::value('export', $field)) {
270 self
::$_export['option_group'] = & $fields[$name];
272 self
::$_export[$name] = & $fields[$name];
277 return self
::$_export;