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/OptionValue.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:cfa37dbb4bcb24f01ea8c59d2e2705e3)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_OptionValue
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_option_value';
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
58 * Group which this option belongs to.
62 public $option_group_id;
64 * Option string as displayed to users - e.g. the label in an HTML OPTION tag.
70 * The actual value stored (as a foreign key) in the data record. Functions which need lookup option_value.title should use civicrm_option_value.option_group_id plus civicrm_option_value.value as the key.
76 * Stores a fixed (non-translated) name for this option value. Lookup functions should use the name as the key for the option value row.
82 * Use to sort and/or set display properties for sub-set(s) of options within an option group. EXAMPLE: Use for college_interest field, to differentiate partners from non-partners.
88 * Bitwise logic can be used to create subsets of options within an option_group for different uses.
94 * Is this the default option for the group?
100 * Controls display sort order.
106 * Optional description.
112 * Is this row simply a display header? Expected usage is to render these as OPTGROUP tags within a SELECT field list of options?
118 * Is this a predefined system object?
124 * Is this option active?
130 * Component that this option value belongs/caters to.
134 public $component_id;
136 * Which Domain is this option value for
145 public $visibility_id;
149 * @return civicrm_option_value
151 function __construct() {
152 $this->__table
= 'civicrm_option_value';
153 parent
::__construct();
156 * Returns foreign keys and entity references
159 * [CRM_Core_Reference_Interface]
161 static function getReferenceColumns() {
162 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
163 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
164 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'option_group_id', 'civicrm_option_group', 'id');
165 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'component_id', 'civicrm_component', 'id');
166 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'domain_id', 'civicrm_domain', 'id');
167 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
169 return Civi
::$statics[__CLASS__
]['links'];
172 * Returns all the column names of this table
176 static function &fields() {
177 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
178 Civi
::$statics[__CLASS__
]['fields'] = array(
181 'type' => CRM_Utils_Type
::T_INT
,
182 'title' => ts('Option Value ID') ,
183 'description' => 'Option ID',
186 'option_group_id' => array(
187 'name' => 'option_group_id',
188 'type' => CRM_Utils_Type
::T_INT
,
189 'title' => ts('Option Group ID') ,
190 'description' => 'Group which this option belongs to.',
192 'FKClassName' => 'CRM_Core_DAO_OptionGroup',
196 'pseudoconstant' => array(
197 'table' => 'civicrm_option_group',
199 'labelColumn' => 'name',
204 'type' => CRM_Utils_Type
::T_STRING
,
205 'title' => ts('Option Label') ,
206 'description' => 'Option string as displayed to users - e.g. the label in an HTML OPTION tag.',
209 'size' => CRM_Utils_Type
::HUGE
,
213 'type' => CRM_Utils_Type
::T_STRING
,
214 'title' => ts('Option Value') ,
215 'description' => 'The actual value stored (as a foreign key) in the data record. Functions which need lookup option_value.title should use civicrm_option_value.option_group_id plus civicrm_option_value.value as the key.',
218 'size' => CRM_Utils_Type
::HUGE
,
222 'type' => CRM_Utils_Type
::T_STRING
,
223 'title' => ts('Option Name') ,
224 'description' => 'Stores a fixed (non-translated) name for this option value. Lookup functions should use the name as the key for the option value row.',
226 'size' => CRM_Utils_Type
::HUGE
,
228 'where' => 'civicrm_option_value.name',
229 'headerPattern' => '',
234 'name' => 'grouping',
235 'type' => CRM_Utils_Type
::T_STRING
,
236 'title' => ts('Option Grouping Name') ,
237 'description' => 'Use to sort and/or set display properties for sub-set(s) of options within an option group. EXAMPLE: Use for college_interest field, to differentiate partners from non-partners.',
239 'size' => CRM_Utils_Type
::HUGE
,
243 'type' => CRM_Utils_Type
::T_INT
,
244 'title' => ts('Filter') ,
245 'description' => 'Bitwise logic can be used to create subsets of options within an option_group for different uses.',
247 'is_default' => array(
248 'name' => 'is_default',
249 'type' => CRM_Utils_Type
::T_BOOLEAN
,
250 'title' => ts('Option is Default?') ,
251 'description' => 'Is this the default option for the group?',
255 'type' => CRM_Utils_Type
::T_INT
,
256 'title' => ts('Order') ,
257 'description' => 'Controls display sort order.',
260 'description' => array(
261 'name' => 'description',
262 'type' => CRM_Utils_Type
::T_TEXT
,
263 'title' => ts('Option Description') ,
264 'description' => 'Optional description.',
268 'type' => 'TextArea',
271 'is_optgroup' => array(
272 'name' => 'is_optgroup',
273 'type' => CRM_Utils_Type
::T_BOOLEAN
,
274 'title' => ts('Option is Header?') ,
275 'description' => 'Is this row simply a display header? Expected usage is to render these as OPTGROUP tags within a SELECT field list of options?',
277 'is_reserved' => array(
278 'name' => 'is_reserved',
279 'type' => CRM_Utils_Type
::T_BOOLEAN
,
280 'title' => ts('Option Is Reserved?') ,
281 'description' => 'Is this a predefined system object?',
283 'is_active' => array(
284 'name' => 'is_active',
285 'type' => CRM_Utils_Type
::T_BOOLEAN
,
286 'title' => ts('Option Is Active') ,
287 'description' => 'Is this option active?',
290 'component_id' => array(
291 'name' => 'component_id',
292 'type' => CRM_Utils_Type
::T_INT
,
293 'title' => ts('Option Component') ,
294 'description' => 'Component that this option value belongs/caters to.',
295 'FKClassName' => 'CRM_Core_DAO_Component',
299 'pseudoconstant' => array(
300 'table' => 'civicrm_component',
302 'labelColumn' => 'name',
305 'domain_id' => array(
306 'name' => 'domain_id',
307 'type' => CRM_Utils_Type
::T_INT
,
308 'title' => ts('Option Domain') ,
309 'description' => 'Which Domain is this option value for',
310 'FKClassName' => 'CRM_Core_DAO_Domain',
311 'pseudoconstant' => array(
312 'table' => 'civicrm_domain',
314 'labelColumn' => 'name',
317 'visibility_id' => array(
318 'name' => 'visibility_id',
319 'type' => CRM_Utils_Type
::T_INT
,
320 'title' => ts('Option Visibility') ,
324 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
326 return Civi
::$statics[__CLASS__
]['fields'];
329 * Return a mapping from field-name to the corresponding key (as used in fields()).
332 * Array(string $name => string $uniqueName).
334 static function &fieldKeys() {
335 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
336 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
338 return Civi
::$statics[__CLASS__
]['fieldKeys'];
341 * Returns the names of this table
345 static function getTableName() {
346 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
349 * Returns if this table needs to be logged
357 * Returns the list of fields that can be imported
359 * @param bool $prefix
363 static function &import($prefix = false) {
364 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'option_value', $prefix, array());
368 * Returns the list of fields that can be exported
370 * @param bool $prefix
374 static function &export($prefix = false) {
375 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'option_value', $prefix, array());