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:08d2151b75e68f334bd88475b58fab7b)
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.
98 public static function getEntityTitle() {
99 return ts('Extensions');
103 * Returns all the column names of this table
107 public static function &fields() {
108 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
109 Civi
::$statics[__CLASS__
]['fields'] = [
112 'type' => CRM_Utils_Type
::T_INT
,
113 'title' => ts('Extension ID'),
114 'description' => ts('Local Extension ID'),
116 'where' => 'civicrm_extension.id',
117 'table_name' => 'civicrm_extension',
118 'entity' => 'Extension',
119 'bao' => 'CRM_Core_BAO_Extension',
125 'type' => CRM_Utils_Type
::T_STRING
,
126 'title' => ts('Type'),
129 'size' => CRM_Utils_Type
::EIGHT
,
130 'where' => 'civicrm_extension.type',
131 'table_name' => 'civicrm_extension',
132 'entity' => 'Extension',
133 'bao' => 'CRM_Core_BAO_Extension',
138 'pseudoconstant' => [
139 'callback' => 'CRM_Core_SelectValues::getExtensionTypes',
144 'name' => 'full_name',
145 'type' => CRM_Utils_Type
::T_STRING
,
146 'title' => ts('Key'),
147 'description' => ts('Fully qualified extension name'),
150 'size' => CRM_Utils_Type
::HUGE
,
151 'where' => 'civicrm_extension.full_name',
152 'table_name' => 'civicrm_extension',
153 'entity' => 'Extension',
154 'bao' => 'CRM_Core_BAO_Extension',
160 'type' => CRM_Utils_Type
::T_STRING
,
161 'title' => ts('Name'),
162 'description' => ts('Short name'),
164 'size' => CRM_Utils_Type
::HUGE
,
166 'where' => 'civicrm_extension.name',
168 'table_name' => 'civicrm_extension',
169 'entity' => 'Extension',
170 'bao' => 'CRM_Core_BAO_Extension',
176 'type' => CRM_Utils_Type
::T_STRING
,
177 'title' => ts('Label'),
178 'description' => ts('Short, printable name'),
180 'size' => CRM_Utils_Type
::HUGE
,
182 'where' => 'civicrm_extension.label',
184 'table_name' => 'civicrm_extension',
185 'entity' => 'Extension',
186 'bao' => 'CRM_Core_BAO_Extension',
192 'type' => CRM_Utils_Type
::T_STRING
,
193 'title' => ts('File'),
194 'description' => ts('Primary PHP file'),
196 'size' => CRM_Utils_Type
::HUGE
,
198 'where' => 'civicrm_extension.file',
200 'table_name' => 'civicrm_extension',
201 'entity' => 'Extension',
202 'bao' => 'CRM_Core_BAO_Extension',
206 'schema_version' => [
207 'name' => 'schema_version',
208 'type' => CRM_Utils_Type
::T_STRING
,
209 'title' => ts('Schema Version'),
210 'description' => ts('Revision code of the database schema; the format is module-defined'),
212 'size' => CRM_Utils_Type
::BIG
,
214 'where' => 'civicrm_extension.schema_version',
216 'table_name' => 'civicrm_extension',
217 'entity' => 'Extension',
218 'bao' => 'CRM_Core_BAO_Extension',
223 'name' => 'is_active',
224 'type' => CRM_Utils_Type
::T_BOOLEAN
,
225 'title' => ts('Extension is Active?'),
226 'description' => ts('Is this extension active?'),
227 'where' => 'civicrm_extension.is_active',
229 'table_name' => 'civicrm_extension',
230 'entity' => 'Extension',
231 'bao' => 'CRM_Core_BAO_Extension',
236 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
238 return Civi
::$statics[__CLASS__
]['fields'];
242 * Return a mapping from field-name to the corresponding key (as used in fields()).
245 * Array(string $name => string $uniqueName).
247 public static function &fieldKeys() {
248 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
249 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
251 return Civi
::$statics[__CLASS__
]['fieldKeys'];
255 * Returns the names of this table
259 public static function getTableName() {
260 return self
::$_tableName;
264 * Returns if this table needs to be logged
268 public function getLog() {
273 * Returns the list of fields that can be imported
275 * @param bool $prefix
279 public static function &import($prefix = FALSE) {
280 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'extension', $prefix, []);
285 * Returns the list of fields that can be exported
287 * @param bool $prefix
291 public static function &export($prefix = FALSE) {
292 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'extension', $prefix, []);
297 * Returns the list of indices
299 * @param bool $localize
303 public static function indices($localize = TRUE) {
305 'UI_extension_full_name' => [
306 'name' => 'UI_extension_full_name',
310 'localizable' => FALSE,
312 'sig' => 'civicrm_extension::1::full_name',
314 'UI_extension_name' => [
315 'name' => 'UI_extension_name',
319 'localizable' => FALSE,
320 'sig' => 'civicrm_extension::0::name',
323 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;