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:46f6ff725b1ad9909d2340d728438d36)
13 * Database access object for the Extension entity.
15 class CRM_Core_DAO_Extension
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '4.2';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_extension';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
46 * Fully qualified extension name
60 * Short, printable name
74 * Revision code of the database schema; the format is module-defined
78 public $schema_version;
81 * Is this extension active?
90 public function __construct() {
91 $this->__table
= 'civicrm_extension';
92 parent
::__construct();
96 * Returns localized title of this entity.
99 * Whether to return the plural version of the title.
101 public static function getEntityTitle($plural = FALSE) {
102 return $plural ?
ts('Extensions') : ts('Extension');
106 * Returns all the column names of this table
110 public static function &fields() {
111 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
112 Civi
::$statics[__CLASS__
]['fields'] = [
115 'type' => CRM_Utils_Type
::T_INT
,
116 'title' => ts('Extension ID'),
117 'description' => ts('Local Extension ID'),
119 'where' => 'civicrm_extension.id',
120 'table_name' => 'civicrm_extension',
121 'entity' => 'Extension',
122 'bao' => 'CRM_Core_BAO_Extension',
128 'type' => CRM_Utils_Type
::T_STRING
,
129 'title' => ts('Type'),
132 'size' => CRM_Utils_Type
::EIGHT
,
133 'where' => 'civicrm_extension.type',
134 'table_name' => 'civicrm_extension',
135 'entity' => 'Extension',
136 'bao' => 'CRM_Core_BAO_Extension',
141 'pseudoconstant' => [
142 'callback' => 'CRM_Core_SelectValues::getExtensionTypes',
147 'name' => 'full_name',
148 'type' => CRM_Utils_Type
::T_STRING
,
149 'title' => ts('Key'),
150 'description' => ts('Fully qualified extension name'),
153 'size' => CRM_Utils_Type
::HUGE
,
154 'where' => 'civicrm_extension.full_name',
155 'table_name' => 'civicrm_extension',
156 'entity' => 'Extension',
157 'bao' => 'CRM_Core_BAO_Extension',
163 'type' => CRM_Utils_Type
::T_STRING
,
164 'title' => ts('Name'),
165 'description' => ts('Short name'),
167 'size' => CRM_Utils_Type
::HUGE
,
169 'where' => 'civicrm_extension.name',
171 'table_name' => 'civicrm_extension',
172 'entity' => 'Extension',
173 'bao' => 'CRM_Core_BAO_Extension',
179 'type' => CRM_Utils_Type
::T_STRING
,
180 'title' => ts('Label'),
181 'description' => ts('Short, printable name'),
183 'size' => CRM_Utils_Type
::HUGE
,
185 'where' => 'civicrm_extension.label',
187 'table_name' => 'civicrm_extension',
188 'entity' => 'Extension',
189 'bao' => 'CRM_Core_BAO_Extension',
195 'type' => CRM_Utils_Type
::T_STRING
,
196 'title' => ts('File'),
197 'description' => ts('Primary PHP file'),
199 'size' => CRM_Utils_Type
::HUGE
,
201 'where' => 'civicrm_extension.file',
203 'table_name' => 'civicrm_extension',
204 'entity' => 'Extension',
205 'bao' => 'CRM_Core_BAO_Extension',
209 'schema_version' => [
210 'name' => 'schema_version',
211 'type' => CRM_Utils_Type
::T_STRING
,
212 'title' => ts('Schema Version'),
213 'description' => ts('Revision code of the database schema; the format is module-defined'),
215 'size' => CRM_Utils_Type
::BIG
,
217 'where' => 'civicrm_extension.schema_version',
219 'table_name' => 'civicrm_extension',
220 'entity' => 'Extension',
221 'bao' => 'CRM_Core_BAO_Extension',
226 'name' => 'is_active',
227 'type' => CRM_Utils_Type
::T_BOOLEAN
,
228 'title' => ts('Extension is Active?'),
229 'description' => ts('Is this extension active?'),
230 'where' => 'civicrm_extension.is_active',
232 'table_name' => 'civicrm_extension',
233 'entity' => 'Extension',
234 'bao' => 'CRM_Core_BAO_Extension',
239 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
241 return Civi
::$statics[__CLASS__
]['fields'];
245 * Return a mapping from field-name to the corresponding key (as used in fields()).
248 * Array(string $name => string $uniqueName).
250 public static function &fieldKeys() {
251 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
252 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
254 return Civi
::$statics[__CLASS__
]['fieldKeys'];
258 * Returns the names of this table
262 public static function getTableName() {
263 return self
::$_tableName;
267 * Returns if this table needs to be logged
271 public function getLog() {
276 * Returns the list of fields that can be imported
278 * @param bool $prefix
282 public static function &import($prefix = FALSE) {
283 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'extension', $prefix, []);
288 * Returns the list of fields that can be exported
290 * @param bool $prefix
294 public static function &export($prefix = FALSE) {
295 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'extension', $prefix, []);
300 * Returns the list of indices
302 * @param bool $localize
306 public static function indices($localize = TRUE) {
308 'UI_extension_full_name' => [
309 'name' => 'UI_extension_full_name',
313 'localizable' => FALSE,
315 'sig' => 'civicrm_extension::1::full_name',
317 'UI_extension_name' => [
318 'name' => 'UI_extension_name',
322 'localizable' => FALSE,
323 'sig' => 'civicrm_extension::0::name',
326 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;