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/OptionGroup.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:4f26b702ecd914e653257f0676896d87)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Core_DAO_OptionGroup constructor.
40 class CRM_Core_DAO_OptionGroup
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_option_group';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * Option group name. Used as selection key by class properties which lookup options in civicrm_option_value.
72 * Option group description.
78 * Option group description.
84 * Is this a predefined system option group (i.e. it can not be deleted)?
90 * Is this option group active?
96 * A lock to remove the ability to add new options via the UI.
104 function __construct() {
105 $this->__table
= 'civicrm_option_group';
106 parent
::__construct();
109 * Returns all the column names of this table
113 static function &fields() {
114 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
115 Civi
::$statics[__CLASS__
]['fields'] = array(
118 'type' => CRM_Utils_Type
::T_INT
,
119 'title' => ts('Option Group ID') ,
120 'description' => 'Option Group ID',
122 'table_name' => 'civicrm_option_group',
123 'entity' => 'OptionGroup',
124 'bao' => 'CRM_Core_BAO_OptionGroup',
129 'type' => CRM_Utils_Type
::T_STRING
,
130 'title' => ts('Option Group Name') ,
131 'description' => 'Option group name. Used as selection key by class properties which lookup options in civicrm_option_value.',
134 'size' => CRM_Utils_Type
::BIG
,
135 'table_name' => 'civicrm_option_group',
136 'entity' => 'OptionGroup',
137 'bao' => 'CRM_Core_BAO_OptionGroup',
142 'type' => CRM_Utils_Type
::T_STRING
,
143 'title' => ts('Option Group title') ,
144 'description' => 'Option Group title.',
146 'size' => CRM_Utils_Type
::HUGE
,
147 'table_name' => 'civicrm_option_group',
148 'entity' => 'OptionGroup',
149 'bao' => 'CRM_Core_BAO_OptionGroup',
152 'description' => array(
153 'name' => 'description',
154 'type' => CRM_Utils_Type
::T_STRING
,
155 'title' => ts('Option Group Description') ,
156 'description' => 'Option group description.',
158 'size' => CRM_Utils_Type
::HUGE
,
159 'table_name' => 'civicrm_option_group',
160 'entity' => 'OptionGroup',
161 'bao' => 'CRM_Core_BAO_OptionGroup',
164 'data_type' => array(
165 'name' => 'data_type',
166 'type' => CRM_Utils_Type
::T_STRING
,
167 'title' => ts('Data Type for this option group') ,
168 'description' => 'Option group description.',
170 'size' => CRM_Utils_Type
::HUGE
,
171 'table_name' => 'civicrm_option_group',
172 'entity' => 'OptionGroup',
173 'bao' => 'CRM_Core_BAO_OptionGroup',
175 'pseudoconstant' => array(
176 'callback' => 'CRM_Utils_Type::dataTypes',
179 'is_reserved' => array(
180 'name' => 'is_reserved',
181 'type' => CRM_Utils_Type
::T_BOOLEAN
,
182 'title' => ts('Option Group Is Reserved?') ,
183 'description' => 'Is this a predefined system option group (i.e. it can not be deleted)?',
185 'table_name' => 'civicrm_option_group',
186 'entity' => 'OptionGroup',
187 'bao' => 'CRM_Core_BAO_OptionGroup',
190 'is_active' => array(
191 'name' => 'is_active',
192 'type' => CRM_Utils_Type
::T_BOOLEAN
,
193 'title' => ts('Option Group Is Active?') ,
194 'description' => 'Is this option group active?',
195 'table_name' => 'civicrm_option_group',
196 'entity' => 'OptionGroup',
197 'bao' => 'CRM_Core_BAO_OptionGroup',
200 'is_locked' => array(
201 'name' => 'is_locked',
202 'type' => CRM_Utils_Type
::T_BOOLEAN
,
203 'title' => ts('Option Group Is Locked') ,
204 'description' => 'A lock to remove the ability to add new options via the UI.',
205 'table_name' => 'civicrm_option_group',
206 'entity' => 'OptionGroup',
207 'bao' => 'CRM_Core_BAO_OptionGroup',
211 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
213 return Civi
::$statics[__CLASS__
]['fields'];
216 * Return a mapping from field-name to the corresponding key (as used in fields()).
219 * Array(string $name => string $uniqueName).
221 static function &fieldKeys() {
222 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
223 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
225 return Civi
::$statics[__CLASS__
]['fieldKeys'];
228 * Returns the names of this table
232 static function getTableName() {
233 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
236 * Returns if this table needs to be logged
244 * Returns the list of fields that can be imported
246 * @param bool $prefix
250 static function &import($prefix = false) {
251 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'option_group', $prefix, array());
255 * Returns the list of fields that can be exported
257 * @param bool $prefix
261 static function &export($prefix = false) {
262 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'option_group', $prefix, array());
266 * Returns the list of indices
268 public static function indices($localize = TRUE) {
275 'localizable' => false,
277 'sig' => 'civicrm_option_group::1::name',
280 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;