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:8d9c173c0d7da38d4c28c6b712aecee0)
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',
132 'type' => CRM_Utils_Type
::T_STRING
,
133 'title' => ts('Type'),
136 'size' => CRM_Utils_Type
::EIGHT
,
137 'where' => 'civicrm_extension.type',
138 'table_name' => 'civicrm_extension',
139 'entity' => 'Extension',
140 'bao' => 'CRM_Core_BAO_Extension',
145 'pseudoconstant' => [
146 'callback' => 'CRM_Core_SelectValues::getExtensionTypes',
151 'name' => 'full_name',
152 'type' => CRM_Utils_Type
::T_STRING
,
153 'title' => ts('Key'),
154 'description' => ts('Fully qualified extension name'),
157 'size' => CRM_Utils_Type
::HUGE
,
158 'where' => 'civicrm_extension.full_name',
159 'table_name' => 'civicrm_extension',
160 'entity' => 'Extension',
161 'bao' => 'CRM_Core_BAO_Extension',
167 'type' => CRM_Utils_Type
::T_STRING
,
168 'title' => ts('Name'),
169 'description' => ts('Short name'),
171 'size' => CRM_Utils_Type
::HUGE
,
173 'where' => 'civicrm_extension.name',
175 'table_name' => 'civicrm_extension',
176 'entity' => 'Extension',
177 'bao' => 'CRM_Core_BAO_Extension',
183 'type' => CRM_Utils_Type
::T_STRING
,
184 'title' => ts('Label'),
185 'description' => ts('Short, printable name'),
187 'size' => CRM_Utils_Type
::HUGE
,
189 'where' => 'civicrm_extension.label',
191 'table_name' => 'civicrm_extension',
192 'entity' => 'Extension',
193 'bao' => 'CRM_Core_BAO_Extension',
199 'type' => CRM_Utils_Type
::T_STRING
,
200 'title' => ts('File'),
201 'description' => ts('Primary PHP file'),
203 'size' => CRM_Utils_Type
::HUGE
,
205 'where' => 'civicrm_extension.file',
207 'table_name' => 'civicrm_extension',
208 'entity' => 'Extension',
209 'bao' => 'CRM_Core_BAO_Extension',
213 'schema_version' => [
214 'name' => 'schema_version',
215 'type' => CRM_Utils_Type
::T_STRING
,
216 'title' => ts('Schema Version'),
217 'description' => ts('Revision code of the database schema; the format is module-defined'),
219 'size' => CRM_Utils_Type
::BIG
,
221 'where' => 'civicrm_extension.schema_version',
223 'table_name' => 'civicrm_extension',
224 'entity' => 'Extension',
225 'bao' => 'CRM_Core_BAO_Extension',
230 'name' => 'is_active',
231 'type' => CRM_Utils_Type
::T_BOOLEAN
,
232 'title' => ts('Extension is Active?'),
233 'description' => ts('Is this extension active?'),
234 'where' => 'civicrm_extension.is_active',
236 'table_name' => 'civicrm_extension',
237 'entity' => 'Extension',
238 'bao' => 'CRM_Core_BAO_Extension',
243 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
245 return Civi
::$statics[__CLASS__
]['fields'];
249 * Return a mapping from field-name to the corresponding key (as used in fields()).
252 * Array(string $name => string $uniqueName).
254 public static function &fieldKeys() {
255 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
256 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
258 return Civi
::$statics[__CLASS__
]['fieldKeys'];
262 * Returns the names of this table
266 public static function getTableName() {
267 return self
::$_tableName;
271 * Returns if this table needs to be logged
275 public function getLog() {
280 * Returns the list of fields that can be imported
282 * @param bool $prefix
286 public static function &import($prefix = FALSE) {
287 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'extension', $prefix, []);
292 * Returns the list of fields that can be exported
294 * @param bool $prefix
298 public static function &export($prefix = FALSE) {
299 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'extension', $prefix, []);
304 * Returns the list of indices
306 * @param bool $localize
310 public static function indices($localize = TRUE) {
312 'UI_extension_full_name' => [
313 'name' => 'UI_extension_full_name',
317 'localizable' => FALSE,
319 'sig' => 'civicrm_extension::1::full_name',
321 'UI_extension_name' => [
322 'name' => 'UI_extension_name',
326 'localizable' => FALSE,
327 'sig' => 'civicrm_extension::0::name',
330 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;