5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/Extension.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:3c88066844dbbf70b8ee5593eafe65a4)
13 * Database access object for the Extension entity.
15 class CRM_Core_DAO_Extension
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_extension';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
44 * Fully qualified extension name
58 * Short, printable name
72 * Revision code of the database schema; the format is module-defined
76 public $schema_version;
79 * Is this extension active?
88 public function __construct() {
89 $this->__table
= 'civicrm_extension';
90 parent
::__construct();
94 * Returns all the column names of this table
98 public static function &fields() {
99 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
100 Civi
::$statics[__CLASS__
]['fields'] = [
103 'type' => CRM_Utils_Type
::T_INT
,
104 'title' => ts('Extension ID'),
105 'description' => ts('Local Extension ID'),
107 'where' => 'civicrm_extension.id',
108 'table_name' => 'civicrm_extension',
109 'entity' => 'Extension',
110 'bao' => 'CRM_Core_BAO_Extension',
115 'type' => CRM_Utils_Type
::T_STRING
,
116 'title' => ts('Type'),
119 'size' => CRM_Utils_Type
::EIGHT
,
120 'where' => 'civicrm_extension.type',
121 'table_name' => 'civicrm_extension',
122 'entity' => 'Extension',
123 'bao' => 'CRM_Core_BAO_Extension',
128 'pseudoconstant' => [
129 'callback' => 'CRM_Core_SelectValues::getExtensionTypes',
133 'name' => 'full_name',
134 'type' => CRM_Utils_Type
::T_STRING
,
135 'title' => ts('Key'),
136 'description' => ts('Fully qualified extension name'),
139 'size' => CRM_Utils_Type
::HUGE
,
140 'where' => 'civicrm_extension.full_name',
141 'table_name' => 'civicrm_extension',
142 'entity' => 'Extension',
143 'bao' => 'CRM_Core_BAO_Extension',
148 'type' => CRM_Utils_Type
::T_STRING
,
149 'title' => ts('Name'),
150 'description' => ts('Short name'),
152 'size' => CRM_Utils_Type
::HUGE
,
154 'where' => 'civicrm_extension.name',
156 'table_name' => 'civicrm_extension',
157 'entity' => 'Extension',
158 'bao' => 'CRM_Core_BAO_Extension',
163 'type' => CRM_Utils_Type
::T_STRING
,
164 'title' => ts('Label'),
165 'description' => ts('Short, printable name'),
167 'size' => CRM_Utils_Type
::HUGE
,
169 'where' => 'civicrm_extension.label',
171 'table_name' => 'civicrm_extension',
172 'entity' => 'Extension',
173 'bao' => 'CRM_Core_BAO_Extension',
178 'type' => CRM_Utils_Type
::T_STRING
,
179 'title' => ts('File'),
180 'description' => ts('Primary PHP file'),
182 'size' => CRM_Utils_Type
::HUGE
,
184 'where' => 'civicrm_extension.file',
186 'table_name' => 'civicrm_extension',
187 'entity' => 'Extension',
188 'bao' => 'CRM_Core_BAO_Extension',
191 'schema_version' => [
192 'name' => 'schema_version',
193 'type' => CRM_Utils_Type
::T_STRING
,
194 'title' => ts('Schema Version'),
195 'description' => ts('Revision code of the database schema; the format is module-defined'),
197 'size' => CRM_Utils_Type
::BIG
,
199 'where' => 'civicrm_extension.schema_version',
201 'table_name' => 'civicrm_extension',
202 'entity' => 'Extension',
203 'bao' => 'CRM_Core_BAO_Extension',
207 'name' => 'is_active',
208 'type' => CRM_Utils_Type
::T_BOOLEAN
,
209 'title' => ts('Extension is Active?'),
210 'description' => ts('Is this extension active?'),
211 'where' => 'civicrm_extension.is_active',
213 'table_name' => 'civicrm_extension',
214 'entity' => 'Extension',
215 'bao' => 'CRM_Core_BAO_Extension',
219 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
221 return Civi
::$statics[__CLASS__
]['fields'];
225 * Return a mapping from field-name to the corresponding key (as used in fields()).
228 * Array(string $name => string $uniqueName).
230 public static function &fieldKeys() {
231 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
232 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
234 return Civi
::$statics[__CLASS__
]['fieldKeys'];
238 * Returns the names of this table
242 public static function getTableName() {
243 return self
::$_tableName;
247 * Returns if this table needs to be logged
251 public function getLog() {
256 * Returns the list of fields that can be imported
258 * @param bool $prefix
262 public static function &import($prefix = FALSE) {
263 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'extension', $prefix, []);
268 * Returns the list of fields that can be exported
270 * @param bool $prefix
274 public static function &export($prefix = FALSE) {
275 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'extension', $prefix, []);
280 * Returns the list of indices
282 * @param bool $localize
286 public static function indices($localize = TRUE) {
288 'UI_extension_full_name' => [
289 'name' => 'UI_extension_full_name',
293 'localizable' => FALSE,
295 'sig' => 'civicrm_extension::1::full_name',
297 'UI_extension_name' => [
298 'name' => 'UI_extension_name',
302 'localizable' => FALSE,
303 'sig' => 'civicrm_extension::0::name',
306 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;