commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-old / civicrm / CRM / Core / DAO / OptionGroup.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
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. |
18 | |
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 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2015
30 *
31 * Generated from xml/schema/CRM/Core/OptionGroup.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 */
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Core_DAO_OptionGroup extends CRM_Core_DAO {
37 /**
38 * static instance to hold the table name
39 *
40 * @var string
41 */
42 static $_tableName = 'civicrm_option_group';
43 /**
44 * static instance to hold the field values
45 *
46 * @var array
47 */
48 static $_fields = null;
49 /**
50 * static instance to hold the keys used in $_fields for each field.
51 *
52 * @var array
53 */
54 static $_fieldKeys = null;
55 /**
56 * static instance to hold the FK relationships
57 *
58 * @var string
59 */
60 static $_links = null;
61 /**
62 * static instance to hold the values that can
63 * be imported
64 *
65 * @var array
66 */
67 static $_import = null;
68 /**
69 * static instance to hold the values that can
70 * be exported
71 *
72 * @var array
73 */
74 static $_export = null;
75 /**
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
78 *
79 * @var boolean
80 */
81 static $_log = true;
82 /**
83 * Option Group ID
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * Option group name. Used as selection key by class properties which lookup options in civicrm_option_value.
90 *
91 * @var string
92 */
93 public $name;
94 /**
95 * Option Group title.
96 *
97 * @var string
98 */
99 public $title;
100 /**
101 * Option group description.
102 *
103 * @var string
104 */
105 public $description;
106 /**
107 * Is this a predefined system option group (i.e. it can not be deleted)?
108 *
109 * @var boolean
110 */
111 public $is_reserved;
112 /**
113 * Is this option group active?
114 *
115 * @var boolean
116 */
117 public $is_active;
118 /**
119 * A lock to remove the ability to add new options via the UI.
120 *
121 * @var boolean
122 */
123 public $is_locked;
124 /**
125 * class constructor
126 *
127 * @return civicrm_option_group
128 */
129 function __construct() {
130 $this->__table = 'civicrm_option_group';
131 parent::__construct();
132 }
133 /**
134 * Returns all the column names of this table
135 *
136 * @return array
137 */
138 static function &fields() {
139 if (!(self::$_fields)) {
140 self::$_fields = array(
141 'id' => array(
142 'name' => 'id',
143 'type' => CRM_Utils_Type::T_INT,
144 'title' => ts('Option Group ID') ,
145 'description' => 'Option Group ID',
146 'required' => true,
147 ) ,
148 'name' => array(
149 'name' => 'name',
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.',
153 'required' => true,
154 'maxlength' => 64,
155 'size' => CRM_Utils_Type::BIG,
156 ) ,
157 'title' => array(
158 'name' => 'title',
159 'type' => CRM_Utils_Type::T_STRING,
160 'title' => ts('Option Group title') ,
161 'description' => 'Option Group title.',
162 'maxlength' => 255,
163 'size' => CRM_Utils_Type::HUGE,
164 ) ,
165 'description' => array(
166 'name' => 'description',
167 'type' => CRM_Utils_Type::T_STRING,
168 'title' => ts('Option Group Description') ,
169 'description' => 'Option group description.',
170 'maxlength' => 255,
171 'size' => CRM_Utils_Type::HUGE,
172 ) ,
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)?',
178 'default' => '1',
179 ) ,
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?',
185 ) ,
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.',
191 ) ,
192 );
193 }
194 return self::$_fields;
195 }
196 /**
197 * Returns an array containing, for each field, the arary key used for that
198 * field in self::$_fields.
199 *
200 * @return array
201 */
202 static function &fieldKeys() {
203 if (!(self::$_fieldKeys)) {
204 self::$_fieldKeys = array(
205 'id' => 'id',
206 'name' => 'name',
207 'title' => 'title',
208 'description' => 'description',
209 'is_reserved' => 'is_reserved',
210 'is_active' => 'is_active',
211 'is_locked' => 'is_locked',
212 );
213 }
214 return self::$_fieldKeys;
215 }
216 /**
217 * Returns the names of this table
218 *
219 * @return string
220 */
221 static function getTableName() {
222 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
223 }
224 /**
225 * Returns if this table needs to be logged
226 *
227 * @return boolean
228 */
229 function getLog() {
230 return self::$_log;
231 }
232 /**
233 * Returns the list of fields that can be imported
234 *
235 * @param bool $prefix
236 *
237 * @return array
238 */
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)) {
245 if ($prefix) {
246 self::$_import['option_group'] = & $fields[$name];
247 } else {
248 self::$_import[$name] = & $fields[$name];
249 }
250 }
251 }
252 }
253 return self::$_import;
254 }
255 /**
256 * Returns the list of fields that can be exported
257 *
258 * @param bool $prefix
259 *
260 * @return array
261 */
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)) {
268 if ($prefix) {
269 self::$_export['option_group'] = & $fields[$name];
270 } else {
271 self::$_export[$name] = & $fields[$name];
272 }
273 }
274 }
275 }
276 return self::$_export;
277 }
278 }