Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
ca5cec67 | 5 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Core/Extension.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
74db51d3 | 9 | * (GenCodeChecksum:3c88066844dbbf70b8ee5593eafe65a4) |
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 | */ | |
fa45b5b9 | 22 | public 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 | */ |
fa45b5b9 | 29 | public static $_log = FALSE; |
c3fc2621 | 30 | |
e501603b TO |
31 | /** |
32 | * Local Extension ID | |
33 | * | |
e6ca0a57 | 34 | * @var int |
e501603b TO |
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 | * | |
e6ca0a57 | 81 | * @var bool |
e501603b TO |
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, |
a36434b9 | 107 | 'where' => 'civicrm_extension.id', |
522a26c9 | 108 | 'table_name' => 'civicrm_extension', |
109 | 'entity' => 'Extension', | |
110 | 'bao' => 'CRM_Core_BAO_Extension', | |
6a7e5e5d | 111 | 'localizable' => 0, |
c3fc2621 CW |
112 | ], |
113 | 'type' => [ | |
e501603b TO |
114 | 'name' => 'type', |
115 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 CW |
116 | 'title' => ts('Type'), |
117 | 'required' => TRUE, | |
e501603b TO |
118 | 'maxlength' => 8, |
119 | 'size' => CRM_Utils_Type::EIGHT, | |
a36434b9 | 120 | 'where' => 'civicrm_extension.type', |
522a26c9 | 121 | 'table_name' => 'civicrm_extension', |
122 | 'entity' => 'Extension', | |
123 | 'bao' => 'CRM_Core_BAO_Extension', | |
6a7e5e5d | 124 | 'localizable' => 0, |
c3fc2621 | 125 | 'html' => [ |
e501603b | 126 | 'type' => 'Select', |
c3fc2621 CW |
127 | ], |
128 | 'pseudoconstant' => [ | |
e501603b | 129 | 'callback' => 'CRM_Core_SelectValues::getExtensionTypes', |
e6ca0a57 | 130 | ], |
c3fc2621 CW |
131 | ], |
132 | 'full_name' => [ | |
e501603b TO |
133 | 'name' => 'full_name', |
134 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 135 | 'title' => ts('Key'), |
215b423e | 136 | 'description' => ts('Fully qualified extension name'), |
c3fc2621 | 137 | 'required' => TRUE, |
e501603b TO |
138 | 'maxlength' => 255, |
139 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 140 | 'where' => 'civicrm_extension.full_name', |
522a26c9 | 141 | 'table_name' => 'civicrm_extension', |
142 | 'entity' => 'Extension', | |
143 | 'bao' => 'CRM_Core_BAO_Extension', | |
6a7e5e5d | 144 | 'localizable' => 0, |
c3fc2621 CW |
145 | ], |
146 | 'name' => [ | |
e501603b TO |
147 | 'name' => 'name', |
148 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 149 | 'title' => ts('Name'), |
215b423e | 150 | 'description' => ts('Short name'), |
e501603b TO |
151 | 'maxlength' => 255, |
152 | 'size' => CRM_Utils_Type::HUGE, | |
c3fc2621 | 153 | 'import' => TRUE, |
e501603b | 154 | 'where' => 'civicrm_extension.name', |
c3fc2621 | 155 | 'export' => TRUE, |
522a26c9 | 156 | 'table_name' => 'civicrm_extension', |
157 | 'entity' => 'Extension', | |
158 | 'bao' => 'CRM_Core_BAO_Extension', | |
6a7e5e5d | 159 | 'localizable' => 0, |
c3fc2621 CW |
160 | ], |
161 | 'label' => [ | |
e501603b TO |
162 | 'name' => 'label', |
163 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 164 | 'title' => ts('Label'), |
215b423e | 165 | 'description' => ts('Short, printable name'), |
e501603b TO |
166 | 'maxlength' => 255, |
167 | 'size' => CRM_Utils_Type::HUGE, | |
c3fc2621 | 168 | 'import' => TRUE, |
e501603b | 169 | 'where' => 'civicrm_extension.label', |
c3fc2621 | 170 | 'export' => TRUE, |
522a26c9 | 171 | 'table_name' => 'civicrm_extension', |
172 | 'entity' => 'Extension', | |
173 | 'bao' => 'CRM_Core_BAO_Extension', | |
6a7e5e5d | 174 | 'localizable' => 0, |
c3fc2621 CW |
175 | ], |
176 | 'file' => [ | |
e501603b TO |
177 | 'name' => 'file', |
178 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 179 | 'title' => ts('File'), |
215b423e | 180 | 'description' => ts('Primary PHP file'), |
e501603b TO |
181 | 'maxlength' => 255, |
182 | 'size' => CRM_Utils_Type::HUGE, | |
c3fc2621 | 183 | 'import' => TRUE, |
e501603b | 184 | 'where' => 'civicrm_extension.file', |
c3fc2621 | 185 | 'export' => TRUE, |
522a26c9 | 186 | 'table_name' => 'civicrm_extension', |
187 | 'entity' => 'Extension', | |
188 | 'bao' => 'CRM_Core_BAO_Extension', | |
6a7e5e5d | 189 | 'localizable' => 0, |
c3fc2621 CW |
190 | ], |
191 | 'schema_version' => [ | |
e501603b TO |
192 | 'name' => 'schema_version', |
193 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 194 | 'title' => ts('Schema Version'), |
215b423e | 195 | 'description' => ts('Revision code of the database schema; the format is module-defined'), |
e501603b TO |
196 | 'maxlength' => 63, |
197 | 'size' => CRM_Utils_Type::BIG, | |
c3fc2621 | 198 | 'import' => TRUE, |
e501603b | 199 | 'where' => 'civicrm_extension.schema_version', |
c3fc2621 | 200 | 'export' => TRUE, |
522a26c9 | 201 | 'table_name' => 'civicrm_extension', |
202 | 'entity' => 'Extension', | |
203 | 'bao' => 'CRM_Core_BAO_Extension', | |
6a7e5e5d | 204 | 'localizable' => 0, |
c3fc2621 CW |
205 | ], |
206 | 'is_active' => [ | |
e501603b TO |
207 | 'name' => 'is_active', |
208 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 209 | 'title' => ts('Extension is Active?'), |
215b423e | 210 | 'description' => ts('Is this extension active?'), |
a36434b9 | 211 | 'where' => 'civicrm_extension.is_active', |
e501603b | 212 | 'default' => '1', |
522a26c9 | 213 | 'table_name' => 'civicrm_extension', |
214 | 'entity' => 'Extension', | |
215 | 'bao' => 'CRM_Core_BAO_Extension', | |
6a7e5e5d | 216 | 'localizable' => 0, |
c3fc2621 CW |
217 | ], |
218 | ]; | |
346aaaba | 219 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 220 | } |
346aaaba | 221 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 222 | } |
c3fc2621 | 223 | |
e501603b | 224 | /** |
bd8e0b14 | 225 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
226 | * |
227 | * @return array | |
bd8e0b14 | 228 | * Array(string $name => string $uniqueName). |
e501603b | 229 | */ |
c3fc2621 | 230 | public static function &fieldKeys() { |
bd8e0b14 TO |
231 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
232 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 233 | } |
bd8e0b14 | 234 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 235 | } |
c3fc2621 | 236 | |
e501603b TO |
237 | /** |
238 | * Returns the names of this table | |
239 | * | |
240 | * @return string | |
241 | */ | |
c3fc2621 | 242 | public static function getTableName() { |
e501603b TO |
243 | return self::$_tableName; |
244 | } | |
c3fc2621 | 245 | |
e501603b TO |
246 | /** |
247 | * Returns if this table needs to be logged | |
248 | * | |
c3fc2621 | 249 | * @return bool |
e501603b | 250 | */ |
c3fc2621 | 251 | public function getLog() { |
e501603b TO |
252 | return self::$_log; |
253 | } | |
c3fc2621 | 254 | |
e501603b TO |
255 | /** |
256 | * Returns the list of fields that can be imported | |
257 | * | |
258 | * @param bool $prefix | |
259 | * | |
260 | * @return array | |
261 | */ | |
c3fc2621 CW |
262 | public static function &import($prefix = FALSE) { |
263 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'extension', $prefix, []); | |
60808919 | 264 | return $r; |
e501603b | 265 | } |
c3fc2621 | 266 | |
e501603b TO |
267 | /** |
268 | * Returns the list of fields that can be exported | |
269 | * | |
270 | * @param bool $prefix | |
271 | * | |
272 | * @return array | |
273 | */ | |
c3fc2621 CW |
274 | public static function &export($prefix = FALSE) { |
275 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'extension', $prefix, []); | |
60808919 | 276 | return $r; |
e501603b | 277 | } |
c3fc2621 | 278 | |
e7a6b91a AS |
279 | /** |
280 | * Returns the list of indices | |
c3fc2621 CW |
281 | * |
282 | * @param bool $localize | |
283 | * | |
284 | * @return array | |
e7a6b91a AS |
285 | */ |
286 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
287 | $indices = [ |
288 | 'UI_extension_full_name' => [ | |
e7a6b91a | 289 | 'name' => 'UI_extension_full_name', |
c3fc2621 | 290 | 'field' => [ |
e7a6b91a | 291 | 0 => 'full_name', |
c3fc2621 CW |
292 | ], |
293 | 'localizable' => FALSE, | |
294 | 'unique' => TRUE, | |
e7a6b91a | 295 | 'sig' => 'civicrm_extension::1::full_name', |
c3fc2621 CW |
296 | ], |
297 | 'UI_extension_name' => [ | |
e7a6b91a | 298 | 'name' => 'UI_extension_name', |
c3fc2621 | 299 | 'field' => [ |
e7a6b91a | 300 | 0 => 'name', |
c3fc2621 CW |
301 | ], |
302 | 'localizable' => FALSE, | |
e7a6b91a | 303 | 'sig' => 'civicrm_extension::0::name', |
c3fc2621 CW |
304 | ], |
305 | ]; | |
e7a6b91a AS |
306 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
307 | } | |
c3fc2621 | 308 | |
e501603b | 309 | } |