Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
6b83d5bd | 5 | * @copyright CiviCRM LLC (c) 2004-2019 |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Core/Extension.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
e380ee3b | 9 | * (GenCodeChecksum:02c87fb773b6c1e61e48e0ddfac2bb5a) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the Extension entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Core_DAO_Extension extends CRM_Core_DAO { |
c3fc2621 | 16 | |
e501603b | 17 | /** |
f41f0342 | 18 | * Static instance to hold the table name. |
e501603b TO |
19 | * |
20 | * @var string | |
21 | */ | |
22 | static $_tableName = 'civicrm_extension'; | |
c3fc2621 | 23 | |
e501603b | 24 | /** |
f41f0342 | 25 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 26 | * |
c3fc2621 | 27 | * @var bool |
e501603b | 28 | */ |
c3fc2621 CW |
29 | static $_log = FALSE; |
30 | ||
e501603b TO |
31 | /** |
32 | * Local Extension ID | |
33 | * | |
34 | * @var int unsigned | |
35 | */ | |
36 | public $id; | |
c3fc2621 | 37 | |
e501603b | 38 | /** |
e501603b TO |
39 | * @var string |
40 | */ | |
41 | public $type; | |
c3fc2621 | 42 | |
e501603b TO |
43 | /** |
44 | * Fully qualified extension name | |
45 | * | |
46 | * @var string | |
47 | */ | |
48 | public $full_name; | |
c3fc2621 | 49 | |
e501603b TO |
50 | /** |
51 | * Short name | |
52 | * | |
53 | * @var string | |
54 | */ | |
55 | public $name; | |
c3fc2621 | 56 | |
e501603b TO |
57 | /** |
58 | * Short, printable name | |
59 | * | |
60 | * @var string | |
61 | */ | |
62 | public $label; | |
c3fc2621 | 63 | |
e501603b TO |
64 | /** |
65 | * Primary PHP file | |
66 | * | |
67 | * @var string | |
68 | */ | |
69 | public $file; | |
c3fc2621 | 70 | |
e501603b TO |
71 | /** |
72 | * Revision code of the database schema; the format is module-defined | |
73 | * | |
74 | * @var string | |
75 | */ | |
76 | public $schema_version; | |
c3fc2621 | 77 | |
e501603b TO |
78 | /** |
79 | * Is this extension active? | |
80 | * | |
81 | * @var boolean | |
82 | */ | |
83 | public $is_active; | |
c3fc2621 | 84 | |
e501603b | 85 | /** |
f41f0342 | 86 | * Class constructor. |
e501603b | 87 | */ |
c3fc2621 | 88 | public function __construct() { |
e501603b TO |
89 | $this->__table = 'civicrm_extension'; |
90 | parent::__construct(); | |
91 | } | |
c3fc2621 | 92 | |
e501603b TO |
93 | /** |
94 | * Returns all the column names of this table | |
95 | * | |
96 | * @return array | |
97 | */ | |
c3fc2621 | 98 | public static function &fields() { |
346aaaba | 99 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
100 | Civi::$statics[__CLASS__]['fields'] = [ |
101 | 'id' => [ | |
e501603b TO |
102 | 'name' => 'id', |
103 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 104 | 'title' => ts('Extension ID'), |
215b423e | 105 | 'description' => ts('Local Extension ID'), |
c3fc2621 | 106 | 'required' => TRUE, |
522a26c9 | 107 | 'table_name' => 'civicrm_extension', |
108 | 'entity' => 'Extension', | |
109 | 'bao' => 'CRM_Core_BAO_Extension', | |
6a7e5e5d | 110 | 'localizable' => 0, |
c3fc2621 CW |
111 | ], |
112 | 'type' => [ | |
e501603b TO |
113 | 'name' => 'type', |
114 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 CW |
115 | 'title' => ts('Type'), |
116 | 'required' => TRUE, | |
e501603b TO |
117 | 'maxlength' => 8, |
118 | 'size' => CRM_Utils_Type::EIGHT, | |
522a26c9 | 119 | 'table_name' => 'civicrm_extension', |
120 | 'entity' => 'Extension', | |
121 | 'bao' => 'CRM_Core_BAO_Extension', | |
6a7e5e5d | 122 | 'localizable' => 0, |
c3fc2621 | 123 | 'html' => [ |
e501603b | 124 | 'type' => 'Select', |
c3fc2621 CW |
125 | ], |
126 | 'pseudoconstant' => [ | |
e501603b | 127 | 'callback' => 'CRM_Core_SelectValues::getExtensionTypes', |
c3fc2621 CW |
128 | ] |
129 | ], | |
130 | 'full_name' => [ | |
e501603b TO |
131 | 'name' => 'full_name', |
132 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 133 | 'title' => ts('Key'), |
215b423e | 134 | 'description' => ts('Fully qualified extension name'), |
c3fc2621 | 135 | 'required' => TRUE, |
e501603b TO |
136 | 'maxlength' => 255, |
137 | 'size' => CRM_Utils_Type::HUGE, | |
522a26c9 | 138 | 'table_name' => 'civicrm_extension', |
139 | 'entity' => 'Extension', | |
140 | 'bao' => 'CRM_Core_BAO_Extension', | |
6a7e5e5d | 141 | 'localizable' => 0, |
c3fc2621 CW |
142 | ], |
143 | 'name' => [ | |
e501603b TO |
144 | 'name' => 'name', |
145 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 146 | 'title' => ts('Name'), |
215b423e | 147 | 'description' => ts('Short name'), |
e501603b TO |
148 | 'maxlength' => 255, |
149 | 'size' => CRM_Utils_Type::HUGE, | |
c3fc2621 | 150 | 'import' => TRUE, |
e501603b TO |
151 | 'where' => 'civicrm_extension.name', |
152 | 'headerPattern' => '', | |
153 | 'dataPattern' => '', | |
c3fc2621 | 154 | 'export' => TRUE, |
522a26c9 | 155 | 'table_name' => 'civicrm_extension', |
156 | 'entity' => 'Extension', | |
157 | 'bao' => 'CRM_Core_BAO_Extension', | |
6a7e5e5d | 158 | 'localizable' => 0, |
c3fc2621 CW |
159 | ], |
160 | 'label' => [ | |
e501603b TO |
161 | 'name' => 'label', |
162 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 163 | 'title' => ts('Label'), |
215b423e | 164 | 'description' => ts('Short, printable name'), |
e501603b TO |
165 | 'maxlength' => 255, |
166 | 'size' => CRM_Utils_Type::HUGE, | |
c3fc2621 | 167 | 'import' => TRUE, |
e501603b TO |
168 | 'where' => 'civicrm_extension.label', |
169 | 'headerPattern' => '', | |
170 | 'dataPattern' => '', | |
c3fc2621 | 171 | 'export' => TRUE, |
522a26c9 | 172 | 'table_name' => 'civicrm_extension', |
173 | 'entity' => 'Extension', | |
174 | 'bao' => 'CRM_Core_BAO_Extension', | |
6a7e5e5d | 175 | 'localizable' => 0, |
c3fc2621 CW |
176 | ], |
177 | 'file' => [ | |
e501603b TO |
178 | 'name' => 'file', |
179 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 180 | 'title' => ts('File'), |
215b423e | 181 | 'description' => ts('Primary PHP file'), |
e501603b TO |
182 | 'maxlength' => 255, |
183 | 'size' => CRM_Utils_Type::HUGE, | |
c3fc2621 | 184 | 'import' => TRUE, |
e501603b TO |
185 | 'where' => 'civicrm_extension.file', |
186 | 'headerPattern' => '', | |
187 | 'dataPattern' => '', | |
c3fc2621 | 188 | 'export' => TRUE, |
522a26c9 | 189 | 'table_name' => 'civicrm_extension', |
190 | 'entity' => 'Extension', | |
191 | 'bao' => 'CRM_Core_BAO_Extension', | |
6a7e5e5d | 192 | 'localizable' => 0, |
c3fc2621 CW |
193 | ], |
194 | 'schema_version' => [ | |
e501603b TO |
195 | 'name' => 'schema_version', |
196 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 197 | 'title' => ts('Schema Version'), |
215b423e | 198 | 'description' => ts('Revision code of the database schema; the format is module-defined'), |
e501603b TO |
199 | 'maxlength' => 63, |
200 | 'size' => CRM_Utils_Type::BIG, | |
c3fc2621 | 201 | 'import' => TRUE, |
e501603b TO |
202 | 'where' => 'civicrm_extension.schema_version', |
203 | 'headerPattern' => '', | |
204 | 'dataPattern' => '', | |
c3fc2621 | 205 | 'export' => TRUE, |
522a26c9 | 206 | 'table_name' => 'civicrm_extension', |
207 | 'entity' => 'Extension', | |
208 | 'bao' => 'CRM_Core_BAO_Extension', | |
6a7e5e5d | 209 | 'localizable' => 0, |
c3fc2621 CW |
210 | ], |
211 | 'is_active' => [ | |
e501603b TO |
212 | 'name' => 'is_active', |
213 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 214 | 'title' => ts('Extension is Active?'), |
215b423e | 215 | 'description' => ts('Is this extension active?'), |
e501603b | 216 | 'default' => '1', |
522a26c9 | 217 | 'table_name' => 'civicrm_extension', |
218 | 'entity' => 'Extension', | |
219 | 'bao' => 'CRM_Core_BAO_Extension', | |
6a7e5e5d | 220 | 'localizable' => 0, |
c3fc2621 CW |
221 | ], |
222 | ]; | |
346aaaba | 223 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 224 | } |
346aaaba | 225 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 226 | } |
c3fc2621 | 227 | |
e501603b | 228 | /** |
bd8e0b14 | 229 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
230 | * |
231 | * @return array | |
bd8e0b14 | 232 | * Array(string $name => string $uniqueName). |
e501603b | 233 | */ |
c3fc2621 | 234 | public static function &fieldKeys() { |
bd8e0b14 TO |
235 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
236 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 237 | } |
bd8e0b14 | 238 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 239 | } |
c3fc2621 | 240 | |
e501603b TO |
241 | /** |
242 | * Returns the names of this table | |
243 | * | |
244 | * @return string | |
245 | */ | |
c3fc2621 | 246 | public static function getTableName() { |
e501603b TO |
247 | return self::$_tableName; |
248 | } | |
c3fc2621 | 249 | |
e501603b TO |
250 | /** |
251 | * Returns if this table needs to be logged | |
252 | * | |
c3fc2621 | 253 | * @return bool |
e501603b | 254 | */ |
c3fc2621 | 255 | public function getLog() { |
e501603b TO |
256 | return self::$_log; |
257 | } | |
c3fc2621 | 258 | |
e501603b TO |
259 | /** |
260 | * Returns the list of fields that can be imported | |
261 | * | |
262 | * @param bool $prefix | |
263 | * | |
264 | * @return array | |
265 | */ | |
c3fc2621 CW |
266 | public static function &import($prefix = FALSE) { |
267 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'extension', $prefix, []); | |
60808919 | 268 | return $r; |
e501603b | 269 | } |
c3fc2621 | 270 | |
e501603b TO |
271 | /** |
272 | * Returns the list of fields that can be exported | |
273 | * | |
274 | * @param bool $prefix | |
275 | * | |
276 | * @return array | |
277 | */ | |
c3fc2621 CW |
278 | public static function &export($prefix = FALSE) { |
279 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'extension', $prefix, []); | |
60808919 | 280 | return $r; |
e501603b | 281 | } |
c3fc2621 | 282 | |
e7a6b91a AS |
283 | /** |
284 | * Returns the list of indices | |
c3fc2621 CW |
285 | * |
286 | * @param bool $localize | |
287 | * | |
288 | * @return array | |
e7a6b91a AS |
289 | */ |
290 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
291 | $indices = [ |
292 | 'UI_extension_full_name' => [ | |
e7a6b91a | 293 | 'name' => 'UI_extension_full_name', |
c3fc2621 | 294 | 'field' => [ |
e7a6b91a | 295 | 0 => 'full_name', |
c3fc2621 CW |
296 | ], |
297 | 'localizable' => FALSE, | |
298 | 'unique' => TRUE, | |
e7a6b91a | 299 | 'sig' => 'civicrm_extension::1::full_name', |
c3fc2621 CW |
300 | ], |
301 | 'UI_extension_name' => [ | |
e7a6b91a | 302 | 'name' => 'UI_extension_name', |
c3fc2621 | 303 | 'field' => [ |
e7a6b91a | 304 | 0 => 'name', |
c3fc2621 CW |
305 | ], |
306 | 'localizable' => FALSE, | |
e7a6b91a | 307 | 'sig' => 'civicrm_extension::0::name', |
c3fc2621 CW |
308 | ], |
309 | ]; | |
e7a6b91a AS |
310 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
311 | } | |
c3fc2621 | 312 | |
e501603b | 313 | } |