5 * @copyright CiviCRM LLC (c) 2004-2017
7 * Generated from xml/schema/CRM/Core/OptionGroup.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:4f26b702ecd914e653257f0676896d87)
13 * Database access object for the OptionGroup entity.
15 class CRM_Core_DAO_OptionGroup
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 static $_tableName = 'civicrm_option_group';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
39 * Option group name. Used as selection key by class properties which lookup options in civicrm_option_value.
53 * Option group description.
60 * Option group description.
67 * Is this a predefined system option group (i.e. it can not be deleted)?
74 * Is this option group active?
81 * A lock to remove the ability to add new options via the UI.
90 public function __construct() {
91 $this->__table
= 'civicrm_option_group';
92 parent
::__construct();
96 * Returns all the column names of this table
100 public static function &fields() {
101 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
102 Civi
::$statics[__CLASS__
]['fields'] = [
105 'type' => CRM_Utils_Type
::T_INT
,
106 'title' => ts('Option Group ID'),
107 'description' => 'Option Group ID',
109 'table_name' => 'civicrm_option_group',
110 'entity' => 'OptionGroup',
111 'bao' => 'CRM_Core_BAO_OptionGroup',
116 'type' => CRM_Utils_Type
::T_STRING
,
117 'title' => ts('Option Group Name'),
118 'description' => 'Option group name. Used as selection key by class properties which lookup options in civicrm_option_value.',
121 'size' => CRM_Utils_Type
::BIG
,
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 title'),
131 'description' => 'Option Group title.',
133 'size' => CRM_Utils_Type
::HUGE
,
134 'table_name' => 'civicrm_option_group',
135 'entity' => 'OptionGroup',
136 'bao' => 'CRM_Core_BAO_OptionGroup',
140 'name' => 'description',
141 'type' => CRM_Utils_Type
::T_STRING
,
142 'title' => ts('Option Group Description'),
143 'description' => 'Option group description.',
145 'size' => CRM_Utils_Type
::HUGE
,
146 'table_name' => 'civicrm_option_group',
147 'entity' => 'OptionGroup',
148 'bao' => 'CRM_Core_BAO_OptionGroup',
152 'name' => 'data_type',
153 'type' => CRM_Utils_Type
::T_STRING
,
154 'title' => ts('Data Type for this option group'),
155 'description' => 'Option group description.',
157 'size' => CRM_Utils_Type
::HUGE
,
158 'table_name' => 'civicrm_option_group',
159 'entity' => 'OptionGroup',
160 'bao' => 'CRM_Core_BAO_OptionGroup',
162 'pseudoconstant' => [
163 'callback' => 'CRM_Utils_Type::dataTypes',
167 'name' => 'is_reserved',
168 'type' => CRM_Utils_Type
::T_BOOLEAN
,
169 'title' => ts('Option Group Is Reserved?'),
170 'description' => 'Is this a predefined system option group (i.e. it can not be deleted)?',
172 'table_name' => 'civicrm_option_group',
173 'entity' => 'OptionGroup',
174 'bao' => 'CRM_Core_BAO_OptionGroup',
178 'name' => 'is_active',
179 'type' => CRM_Utils_Type
::T_BOOLEAN
,
180 'title' => ts('Option Group Is Active?'),
181 'description' => 'Is this option group active?',
182 'table_name' => 'civicrm_option_group',
183 'entity' => 'OptionGroup',
184 'bao' => 'CRM_Core_BAO_OptionGroup',
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.',
192 'table_name' => 'civicrm_option_group',
193 'entity' => 'OptionGroup',
194 'bao' => 'CRM_Core_BAO_OptionGroup',
198 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
200 return Civi
::$statics[__CLASS__
]['fields'];
204 * Return a mapping from field-name to the corresponding key (as used in fields()).
207 * Array(string $name => string $uniqueName).
209 public static function &fieldKeys() {
210 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
211 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
213 return Civi
::$statics[__CLASS__
]['fieldKeys'];
217 * Returns the names of this table
221 public static function getTableName() {
222 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
226 * Returns if this table needs to be logged
230 public function getLog() {
235 * Returns the list of fields that can be imported
237 * @param bool $prefix
241 public static function &import($prefix = FALSE) {
242 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'option_group', $prefix, []);
247 * Returns the list of fields that can be exported
249 * @param bool $prefix
253 public static function &export($prefix = FALSE) {
254 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'option_group', $prefix, []);
259 * Returns the list of indices
261 * @param bool $localize
265 public static function indices($localize = TRUE) {
272 'localizable' => FALSE,
274 'sig' => 'civicrm_option_group::1::name',
277 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;