5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/Component.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:6c3fd2c8e875746c0ceffa499624f77c)
13 * Database access object for the Component entity.
15 class CRM_Core_DAO_Component
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '2.0';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_component';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
41 * Name of the component.
48 * Path to components main directory in a form of a class namespace.
57 public function __construct() {
58 $this->__table
= 'civicrm_component';
59 parent
::__construct();
63 * Returns localized title of this entity.
65 public static function getEntityTitle() {
66 return ts('Components');
70 * Returns all the column names of this table
74 public static function &fields() {
75 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
76 Civi
::$statics[__CLASS__
]['fields'] = [
79 'type' => CRM_Utils_Type
::T_INT
,
80 'title' => ts('Component ID'),
81 'description' => ts('Component ID'),
83 'where' => 'civicrm_component.id',
84 'table_name' => 'civicrm_component',
85 'entity' => 'Component',
86 'bao' => 'CRM_Core_DAO_Component',
92 'type' => CRM_Utils_Type
::T_STRING
,
93 'title' => ts('Component name'),
94 'description' => ts('Name of the component.'),
97 'size' => CRM_Utils_Type
::BIG
,
98 'where' => 'civicrm_component.name',
99 'table_name' => 'civicrm_component',
100 'entity' => 'Component',
101 'bao' => 'CRM_Core_DAO_Component',
106 'name' => 'namespace',
107 'type' => CRM_Utils_Type
::T_STRING
,
108 'title' => ts('Namespace reserved for component.'),
109 'description' => ts('Path to components main directory in a form of a class namespace.'),
111 'size' => CRM_Utils_Type
::HUGE
,
112 'where' => 'civicrm_component.namespace',
113 'table_name' => 'civicrm_component',
114 'entity' => 'Component',
115 'bao' => 'CRM_Core_DAO_Component',
120 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
122 return Civi
::$statics[__CLASS__
]['fields'];
126 * Return a mapping from field-name to the corresponding key (as used in fields()).
129 * Array(string $name => string $uniqueName).
131 public static function &fieldKeys() {
132 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
133 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
135 return Civi
::$statics[__CLASS__
]['fieldKeys'];
139 * Returns the names of this table
143 public static function getTableName() {
144 return self
::$_tableName;
148 * Returns if this table needs to be logged
152 public function getLog() {
157 * Returns the list of fields that can be imported
159 * @param bool $prefix
163 public static function &import($prefix = FALSE) {
164 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'component', $prefix, []);
169 * Returns the list of fields that can be exported
171 * @param bool $prefix
175 public static function &export($prefix = FALSE) {
176 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'component', $prefix, []);
181 * Returns the list of indices
183 * @param bool $localize
187 public static function indices($localize = TRUE) {
189 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;