5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Core/Extension.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:6fdc48310a3cb4c35b5a3fa3a8aca079)
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 static $_tableName = 'civicrm_extension';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 all the column names of this table
98 public static function &fields() {
99 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
100 Civi
::$statics[__CLASS__
]['fields'] = [
103 'type' => CRM_Utils_Type
::T_INT
,
104 'title' => ts('Extension ID'),
105 'description' => 'Local Extension ID',
107 'table_name' => 'civicrm_extension',
108 'entity' => 'Extension',
109 'bao' => 'CRM_Core_BAO_Extension',
114 'type' => CRM_Utils_Type
::T_STRING
,
115 'title' => ts('Type'),
118 'size' => CRM_Utils_Type
::EIGHT
,
119 'table_name' => 'civicrm_extension',
120 'entity' => 'Extension',
121 'bao' => 'CRM_Core_BAO_Extension',
126 'pseudoconstant' => [
127 'callback' => 'CRM_Core_SelectValues::getExtensionTypes',
131 'name' => 'full_name',
132 'type' => CRM_Utils_Type
::T_STRING
,
133 'title' => ts('Key'),
134 'description' => 'Fully qualified extension name',
137 'size' => CRM_Utils_Type
::HUGE
,
138 'table_name' => 'civicrm_extension',
139 'entity' => 'Extension',
140 'bao' => 'CRM_Core_BAO_Extension',
145 'type' => CRM_Utils_Type
::T_STRING
,
146 'title' => ts('Name'),
147 'description' => 'Short name',
149 'size' => CRM_Utils_Type
::HUGE
,
151 'where' => 'civicrm_extension.name',
152 'headerPattern' => '',
155 'table_name' => 'civicrm_extension',
156 'entity' => 'Extension',
157 'bao' => 'CRM_Core_BAO_Extension',
162 'type' => CRM_Utils_Type
::T_STRING
,
163 'title' => ts('Label'),
164 'description' => 'Short, printable name',
166 'size' => CRM_Utils_Type
::HUGE
,
168 'where' => 'civicrm_extension.label',
169 'headerPattern' => '',
172 'table_name' => 'civicrm_extension',
173 'entity' => 'Extension',
174 'bao' => 'CRM_Core_BAO_Extension',
179 'type' => CRM_Utils_Type
::T_STRING
,
180 'title' => ts('File'),
181 'description' => 'Primary PHP file',
183 'size' => CRM_Utils_Type
::HUGE
,
185 'where' => 'civicrm_extension.file',
186 'headerPattern' => '',
189 'table_name' => 'civicrm_extension',
190 'entity' => 'Extension',
191 'bao' => 'CRM_Core_BAO_Extension',
194 'schema_version' => [
195 'name' => 'schema_version',
196 'type' => CRM_Utils_Type
::T_STRING
,
197 'title' => ts('Schema Version'),
198 'description' => 'Revision code of the database schema; the format is module-defined',
200 'size' => CRM_Utils_Type
::BIG
,
202 'where' => 'civicrm_extension.schema_version',
203 'headerPattern' => '',
206 'table_name' => 'civicrm_extension',
207 'entity' => 'Extension',
208 'bao' => 'CRM_Core_BAO_Extension',
212 'name' => 'is_active',
213 'type' => CRM_Utils_Type
::T_BOOLEAN
,
214 'title' => ts('Extension is Active?'),
215 'description' => 'Is this extension active?',
217 'table_name' => 'civicrm_extension',
218 'entity' => 'Extension',
219 'bao' => 'CRM_Core_BAO_Extension',
223 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
225 return Civi
::$statics[__CLASS__
]['fields'];
229 * Return a mapping from field-name to the corresponding key (as used in fields()).
232 * Array(string $name => string $uniqueName).
234 public static function &fieldKeys() {
235 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
236 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
238 return Civi
::$statics[__CLASS__
]['fieldKeys'];
242 * Returns the names of this table
246 public static function getTableName() {
247 return self
::$_tableName;
251 * Returns if this table needs to be logged
255 public function getLog() {
260 * Returns the list of fields that can be imported
262 * @param bool $prefix
266 public static function &import($prefix = FALSE) {
267 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'extension', $prefix, []);
272 * Returns the list of fields that can be exported
274 * @param bool $prefix
278 public static function &export($prefix = FALSE) {
279 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'extension', $prefix, []);
284 * Returns the list of indices
286 * @param bool $localize
290 public static function indices($localize = TRUE) {
292 'UI_extension_full_name' => [
293 'name' => 'UI_extension_full_name',
297 'localizable' => FALSE,
299 'sig' => 'civicrm_extension::1::full_name',
301 'UI_extension_name' => [
302 'name' => 'UI_extension_name',
306 'localizable' => FALSE,
307 'sig' => 'civicrm_extension::0::name',
310 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;