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:570f59a162584f56d66ee72a09e0c6c9)
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 localized title of this entity.
96 public static function getEntityTitle() {
97 return ts('Extensions');
101 * Returns all the column names of this table
105 public static function &fields() {
106 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
107 Civi
::$statics[__CLASS__
]['fields'] = [
110 'type' => CRM_Utils_Type
::T_INT
,
111 'title' => ts('Extension ID'),
112 'description' => ts('Local Extension ID'),
114 'where' => 'civicrm_extension.id',
115 'table_name' => 'civicrm_extension',
116 'entity' => 'Extension',
117 'bao' => 'CRM_Core_BAO_Extension',
122 'type' => CRM_Utils_Type
::T_STRING
,
123 'title' => ts('Type'),
126 'size' => CRM_Utils_Type
::EIGHT
,
127 'where' => 'civicrm_extension.type',
128 'table_name' => 'civicrm_extension',
129 'entity' => 'Extension',
130 'bao' => 'CRM_Core_BAO_Extension',
135 'pseudoconstant' => [
136 'callback' => 'CRM_Core_SelectValues::getExtensionTypes',
140 'name' => 'full_name',
141 'type' => CRM_Utils_Type
::T_STRING
,
142 'title' => ts('Key'),
143 'description' => ts('Fully qualified extension name'),
146 'size' => CRM_Utils_Type
::HUGE
,
147 'where' => 'civicrm_extension.full_name',
148 'table_name' => 'civicrm_extension',
149 'entity' => 'Extension',
150 'bao' => 'CRM_Core_BAO_Extension',
155 'type' => CRM_Utils_Type
::T_STRING
,
156 'title' => ts('Name'),
157 'description' => ts('Short name'),
159 'size' => CRM_Utils_Type
::HUGE
,
161 'where' => 'civicrm_extension.name',
163 'table_name' => 'civicrm_extension',
164 'entity' => 'Extension',
165 'bao' => 'CRM_Core_BAO_Extension',
170 'type' => CRM_Utils_Type
::T_STRING
,
171 'title' => ts('Label'),
172 'description' => ts('Short, printable name'),
174 'size' => CRM_Utils_Type
::HUGE
,
176 'where' => 'civicrm_extension.label',
178 'table_name' => 'civicrm_extension',
179 'entity' => 'Extension',
180 'bao' => 'CRM_Core_BAO_Extension',
185 'type' => CRM_Utils_Type
::T_STRING
,
186 'title' => ts('File'),
187 'description' => ts('Primary PHP file'),
189 'size' => CRM_Utils_Type
::HUGE
,
191 'where' => 'civicrm_extension.file',
193 'table_name' => 'civicrm_extension',
194 'entity' => 'Extension',
195 'bao' => 'CRM_Core_BAO_Extension',
198 'schema_version' => [
199 'name' => 'schema_version',
200 'type' => CRM_Utils_Type
::T_STRING
,
201 'title' => ts('Schema Version'),
202 'description' => ts('Revision code of the database schema; the format is module-defined'),
204 'size' => CRM_Utils_Type
::BIG
,
206 'where' => 'civicrm_extension.schema_version',
208 'table_name' => 'civicrm_extension',
209 'entity' => 'Extension',
210 'bao' => 'CRM_Core_BAO_Extension',
214 'name' => 'is_active',
215 'type' => CRM_Utils_Type
::T_BOOLEAN
,
216 'title' => ts('Extension is Active?'),
217 'description' => ts('Is this extension active?'),
218 'where' => 'civicrm_extension.is_active',
220 'table_name' => 'civicrm_extension',
221 'entity' => 'Extension',
222 'bao' => 'CRM_Core_BAO_Extension',
226 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
228 return Civi
::$statics[__CLASS__
]['fields'];
232 * Return a mapping from field-name to the corresponding key (as used in fields()).
235 * Array(string $name => string $uniqueName).
237 public static function &fieldKeys() {
238 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
239 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
241 return Civi
::$statics[__CLASS__
]['fieldKeys'];
245 * Returns the names of this table
249 public static function getTableName() {
250 return self
::$_tableName;
254 * Returns if this table needs to be logged
258 public function getLog() {
263 * Returns the list of fields that can be imported
265 * @param bool $prefix
269 public static function &import($prefix = FALSE) {
270 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'extension', $prefix, []);
275 * Returns the list of fields that can be exported
277 * @param bool $prefix
281 public static function &export($prefix = FALSE) {
282 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'extension', $prefix, []);
287 * Returns the list of indices
289 * @param bool $localize
293 public static function indices($localize = TRUE) {
295 'UI_extension_full_name' => [
296 'name' => 'UI_extension_full_name',
300 'localizable' => FALSE,
302 'sig' => 'civicrm_extension::1::full_name',
304 'UI_extension_name' => [
305 'name' => 'UI_extension_name',
309 'localizable' => FALSE,
310 'sig' => 'civicrm_extension::0::name',
313 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;