5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/OptionGroup.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:54d95c919472473c234b6747d668bf85)
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 public static $_tableName = 'civicrm_option_group';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = TRUE;
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' => ts('Option Group ID'),
109 'where' => 'civicrm_option_group.id',
110 'table_name' => 'civicrm_option_group',
111 'entity' => 'OptionGroup',
112 'bao' => 'CRM_Core_BAO_OptionGroup',
117 'type' => CRM_Utils_Type
::T_STRING
,
118 'title' => ts('Option Group Name'),
119 'description' => ts('Option group name. Used as selection key by class properties which lookup options in civicrm_option_value.'),
122 'size' => CRM_Utils_Type
::BIG
,
123 'where' => 'civicrm_option_group.name',
124 'table_name' => 'civicrm_option_group',
125 'entity' => 'OptionGroup',
126 'bao' => 'CRM_Core_BAO_OptionGroup',
131 'type' => CRM_Utils_Type
::T_STRING
,
132 'title' => ts('Option Group title'),
133 'description' => ts('Option Group title.'),
135 'size' => CRM_Utils_Type
::HUGE
,
136 'where' => 'civicrm_option_group.title',
137 'table_name' => 'civicrm_option_group',
138 'entity' => 'OptionGroup',
139 'bao' => 'CRM_Core_BAO_OptionGroup',
143 'name' => 'description',
144 'type' => CRM_Utils_Type
::T_STRING
,
145 'title' => ts('Option Group Description'),
146 'description' => ts('Option group description.'),
148 'size' => CRM_Utils_Type
::HUGE
,
149 'where' => 'civicrm_option_group.description',
150 'table_name' => 'civicrm_option_group',
151 'entity' => 'OptionGroup',
152 'bao' => 'CRM_Core_BAO_OptionGroup',
156 'name' => 'data_type',
157 'type' => CRM_Utils_Type
::T_STRING
,
158 'title' => ts('Data Type for this option group'),
159 'description' => ts('Option group description.'),
161 'size' => CRM_Utils_Type
::HUGE
,
162 'where' => 'civicrm_option_group.data_type',
163 'table_name' => 'civicrm_option_group',
164 'entity' => 'OptionGroup',
165 'bao' => 'CRM_Core_BAO_OptionGroup',
167 'pseudoconstant' => [
168 'callback' => 'CRM_Utils_Type::dataTypes',
172 'name' => 'is_reserved',
173 'type' => CRM_Utils_Type
::T_BOOLEAN
,
174 'title' => ts('Option Group Is Reserved?'),
175 'description' => ts('Is this a predefined system option group (i.e. it can not be deleted)?'),
177 'where' => 'civicrm_option_group.is_reserved',
179 'table_name' => 'civicrm_option_group',
180 'entity' => 'OptionGroup',
181 'bao' => 'CRM_Core_BAO_OptionGroup',
185 'name' => 'is_active',
186 'type' => CRM_Utils_Type
::T_BOOLEAN
,
187 'title' => ts('Option Group Is Active?'),
188 'description' => ts('Is this option group active?'),
190 'where' => 'civicrm_option_group.is_active',
192 'table_name' => 'civicrm_option_group',
193 'entity' => 'OptionGroup',
194 'bao' => 'CRM_Core_BAO_OptionGroup',
198 'name' => 'is_locked',
199 'type' => CRM_Utils_Type
::T_BOOLEAN
,
200 'title' => ts('Option Group Is Locked'),
201 'description' => ts('A lock to remove the ability to add new options via the UI.'),
203 'where' => 'civicrm_option_group.is_locked',
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'];
217 * Return a mapping from field-name to the corresponding key (as used in fields()).
220 * Array(string $name => string $uniqueName).
222 public static function &fieldKeys() {
223 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
224 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
226 return Civi
::$statics[__CLASS__
]['fieldKeys'];
230 * Returns the names of this table
234 public static function getTableName() {
235 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
239 * Returns if this table needs to be logged
243 public function getLog() {
248 * Returns the list of fields that can be imported
250 * @param bool $prefix
254 public static function &import($prefix = FALSE) {
255 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'option_group', $prefix, []);
260 * Returns the list of fields that can be exported
262 * @param bool $prefix
266 public static function &export($prefix = FALSE) {
267 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'option_group', $prefix, []);
272 * Returns the list of indices
274 * @param bool $localize
278 public static function indices($localize = TRUE) {
285 'localizable' => FALSE,
287 'sig' => 'civicrm_option_group::1::name',
290 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;