3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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-2015
31 * Generated from xml/schema/CRM/Core/OptionGroup.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Core_DAO_OptionGroup
extends CRM_Core_DAO
{
38 * static instance to hold the table name
42 static $_tableName = 'civicrm_option_group';
44 * static instance to hold the field values
48 static $_fields = null;
50 * static instance to hold the keys used in $_fields for each field.
54 static $_fieldKeys = null;
56 * static instance to hold the FK relationships
60 static $_links = null;
62 * static instance to hold the values that can
67 static $_import = null;
69 * static instance to hold the values that can
74 static $_export = null;
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
89 * Option group name. Used as selection key by class properties which lookup options in civicrm_option_value.
101 * Option group description.
107 * Is this a predefined system option group (i.e. it can not be deleted)?
113 * Is this option group active?
119 * A lock to remove the ability to add new options via the UI.
127 * @return civicrm_option_group
129 function __construct() {
130 $this->__table
= 'civicrm_option_group';
131 parent
::__construct();
134 * Returns all the column names of this table
138 static function &fields() {
139 if (!(self
::$_fields)) {
140 self
::$_fields = array(
143 'type' => CRM_Utils_Type
::T_INT
,
144 'title' => ts('Option Group ID') ,
145 'description' => 'Option Group ID',
150 'type' => CRM_Utils_Type
::T_STRING
,
151 'title' => ts('Option Group Name') ,
152 'description' => 'Option group name. Used as selection key by class properties which lookup options in civicrm_option_value.',
155 'size' => CRM_Utils_Type
::BIG
,
159 'type' => CRM_Utils_Type
::T_STRING
,
160 'title' => ts('Option Group title') ,
161 'description' => 'Option Group title.',
163 'size' => CRM_Utils_Type
::HUGE
,
165 'description' => array(
166 'name' => 'description',
167 'type' => CRM_Utils_Type
::T_STRING
,
168 'title' => ts('Option Group Description') ,
169 'description' => 'Option group description.',
171 'size' => CRM_Utils_Type
::HUGE
,
173 'is_reserved' => array(
174 'name' => 'is_reserved',
175 'type' => CRM_Utils_Type
::T_BOOLEAN
,
176 'title' => ts('Option Group Is Reserved?') ,
177 'description' => 'Is this a predefined system option group (i.e. it can not be deleted)?',
180 'is_active' => array(
181 'name' => 'is_active',
182 'type' => CRM_Utils_Type
::T_BOOLEAN
,
183 'title' => ts('Option Group Is Active?') ,
184 'description' => 'Is this option group active?',
186 'is_locked' => array(
187 'name' => 'is_locked',
188 'type' => CRM_Utils_Type
::T_BOOLEAN
,
189 'title' => ts('Option Group Is Locked') ,
190 'description' => 'A lock to remove the ability to add new options via the UI.',
194 return self
::$_fields;
197 * Returns an array containing, for each field, the arary key used for that
198 * field in self::$_fields.
202 static function &fieldKeys() {
203 if (!(self
::$_fieldKeys)) {
204 self
::$_fieldKeys = array(
208 'description' => 'description',
209 'is_reserved' => 'is_reserved',
210 'is_active' => 'is_active',
211 'is_locked' => 'is_locked',
214 return self
::$_fieldKeys;
217 * Returns the names of this table
221 static function getTableName() {
222 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
225 * Returns if this table needs to be logged
233 * Returns the list of fields that can be imported
235 * @param bool $prefix
239 static function &import($prefix = false) {
240 if (!(self
::$_import)) {
241 self
::$_import = array();
242 $fields = self
::fields();
243 foreach($fields as $name => $field) {
244 if (CRM_Utils_Array
::value('import', $field)) {
246 self
::$_import['option_group'] = & $fields[$name];
248 self
::$_import[$name] = & $fields[$name];
253 return self
::$_import;
256 * Returns the list of fields that can be exported
258 * @param bool $prefix
262 static function &export($prefix = false) {
263 if (!(self
::$_export)) {
264 self
::$_export = array();
265 $fields = self
::fields();
266 foreach($fields as $name => $field) {
267 if (CRM_Utils_Array
::value('export', $field)) {
269 self
::$_export['option_group'] = & $fields[$name];
271 self
::$_export[$name] = & $fields[$name];
276 return self
::$_export;