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:ff39cae78a2b4804c72ed90b8f22606b)
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;
36 * @var int|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
44 * (SQL type: varchar(8))
45 * Note that values will be retrieved from the database as a string.
50 * Fully qualified extension name
53 * (SQL type: varchar(255))
54 * Note that values will be retrieved from the database as a string.
62 * (SQL type: varchar(255))
63 * Note that values will be retrieved from the database as a string.
68 * Short, printable name
71 * (SQL type: varchar(255))
72 * Note that values will be retrieved from the database as a string.
80 * (SQL type: varchar(255))
81 * Note that values will be retrieved from the database as a string.
86 * Revision code of the database schema; the format is module-defined
89 * (SQL type: varchar(63))
90 * Note that values will be retrieved from the database as a string.
92 public $schema_version;
95 * Is this extension active?
97 * @var bool|string|null
99 * Note that values will be retrieved from the database as a string.
106 public function __construct() {
107 $this->__table
= 'civicrm_extension';
108 parent
::__construct();
112 * Returns localized title of this entity.
114 * @param bool $plural
115 * Whether to return the plural version of the title.
117 public static function getEntityTitle($plural = FALSE) {
118 return $plural ?
ts('Extensions') : ts('Extension');
122 * Returns all the column names of this table
126 public static function &fields() {
127 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
128 Civi
::$statics[__CLASS__
]['fields'] = [
131 'type' => CRM_Utils_Type
::T_INT
,
132 'title' => ts('Extension ID'),
133 'description' => ts('Local Extension ID'),
135 'where' => 'civicrm_extension.id',
136 'table_name' => 'civicrm_extension',
137 'entity' => 'Extension',
138 'bao' => 'CRM_Core_BAO_Extension',
148 'type' => CRM_Utils_Type
::T_STRING
,
149 'title' => ts('Type'),
152 'size' => CRM_Utils_Type
::EIGHT
,
153 'where' => 'civicrm_extension.type',
154 'table_name' => 'civicrm_extension',
155 'entity' => 'Extension',
156 'bao' => 'CRM_Core_BAO_Extension',
161 'pseudoconstant' => [
162 'callback' => 'CRM_Core_SelectValues::getExtensionTypes',
167 'name' => 'full_name',
168 'type' => CRM_Utils_Type
::T_STRING
,
169 'title' => ts('Key'),
170 'description' => ts('Fully qualified extension name'),
173 'size' => CRM_Utils_Type
::HUGE
,
174 'where' => 'civicrm_extension.full_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('Name'),
185 'description' => ts('Short name'),
187 'size' => CRM_Utils_Type
::HUGE
,
189 'where' => 'civicrm_extension.name',
191 'table_name' => 'civicrm_extension',
192 'entity' => 'Extension',
193 'bao' => 'CRM_Core_BAO_Extension',
199 'type' => CRM_Utils_Type
::T_STRING
,
200 'title' => ts('Label'),
201 'description' => ts('Short, printable name'),
203 'size' => CRM_Utils_Type
::HUGE
,
205 'where' => 'civicrm_extension.label',
207 'table_name' => 'civicrm_extension',
208 'entity' => 'Extension',
209 'bao' => 'CRM_Core_BAO_Extension',
215 'type' => CRM_Utils_Type
::T_STRING
,
216 'title' => ts('File'),
217 'description' => ts('Primary PHP file'),
219 'size' => CRM_Utils_Type
::HUGE
,
221 'where' => 'civicrm_extension.file',
223 'table_name' => 'civicrm_extension',
224 'entity' => 'Extension',
225 'bao' => 'CRM_Core_BAO_Extension',
229 'schema_version' => [
230 'name' => 'schema_version',
231 'type' => CRM_Utils_Type
::T_STRING
,
232 'title' => ts('Schema Version'),
233 'description' => ts('Revision code of the database schema; the format is module-defined'),
235 'size' => CRM_Utils_Type
::BIG
,
237 'where' => 'civicrm_extension.schema_version',
239 'table_name' => 'civicrm_extension',
240 'entity' => 'Extension',
241 'bao' => 'CRM_Core_BAO_Extension',
246 'name' => 'is_active',
247 'type' => CRM_Utils_Type
::T_BOOLEAN
,
248 'title' => ts('Extension is Active?'),
249 'description' => ts('Is this extension active?'),
250 'where' => 'civicrm_extension.is_active',
252 'table_name' => 'civicrm_extension',
253 'entity' => 'Extension',
254 'bao' => 'CRM_Core_BAO_Extension',
259 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
261 return Civi
::$statics[__CLASS__
]['fields'];
265 * Return a mapping from field-name to the corresponding key (as used in fields()).
268 * Array(string $name => string $uniqueName).
270 public static function &fieldKeys() {
271 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
272 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
274 return Civi
::$statics[__CLASS__
]['fieldKeys'];
278 * Returns the names of this table
282 public static function getTableName() {
283 return self
::$_tableName;
287 * Returns if this table needs to be logged
291 public function getLog() {
296 * Returns the list of fields that can be imported
298 * @param bool $prefix
302 public static function &import($prefix = FALSE) {
303 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'extension', $prefix, []);
308 * Returns the list of fields that can be exported
310 * @param bool $prefix
314 public static function &export($prefix = FALSE) {
315 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'extension', $prefix, []);
320 * Returns the list of indices
322 * @param bool $localize
326 public static function indices($localize = TRUE) {
328 'UI_extension_full_name' => [
329 'name' => 'UI_extension_full_name',
333 'localizable' => FALSE,
335 'sig' => 'civicrm_extension::1::full_name',
337 'UI_extension_name' => [
338 'name' => 'UI_extension_name',
342 'localizable' => FALSE,
343 'sig' => 'civicrm_extension::0::name',
346 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;