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:a5cc4308aa533a07f2528c5cd3a31896)
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;
36 * @var int|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
43 * Name of the component.
46 * (SQL type: varchar(64))
47 * Note that values will be retrieved from the database as a string.
52 * Path to components main directory in a form of a class namespace.
55 * (SQL type: varchar(128))
56 * Note that values will be retrieved from the database as a string.
63 public function __construct() {
64 $this->__table
= 'civicrm_component';
65 parent
::__construct();
69 * Returns localized title of this entity.
72 * Whether to return the plural version of the title.
74 public static function getEntityTitle($plural = FALSE) {
75 return $plural ?
ts('Components') : ts('Component');
79 * Returns all the column names of this table
83 public static function &fields() {
84 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
85 Civi
::$statics[__CLASS__
]['fields'] = [
88 'type' => CRM_Utils_Type
::T_INT
,
89 'title' => ts('Component ID'),
90 'description' => ts('Component ID'),
92 'where' => 'civicrm_component.id',
93 'table_name' => 'civicrm_component',
94 'entity' => 'Component',
95 'bao' => 'CRM_Core_DAO_Component',
105 'type' => CRM_Utils_Type
::T_STRING
,
106 'title' => ts('Component name'),
107 'description' => ts('Name of the component.'),
110 'size' => CRM_Utils_Type
::BIG
,
111 'where' => 'civicrm_component.name',
112 'table_name' => 'civicrm_component',
113 'entity' => 'Component',
114 'bao' => 'CRM_Core_DAO_Component',
119 'name' => 'namespace',
120 'type' => CRM_Utils_Type
::T_STRING
,
121 'title' => ts('Namespace reserved for component.'),
122 'description' => ts('Path to components main directory in a form of a class namespace.'),
124 'size' => CRM_Utils_Type
::HUGE
,
125 'where' => 'civicrm_component.namespace',
126 'table_name' => 'civicrm_component',
127 'entity' => 'Component',
128 'bao' => 'CRM_Core_DAO_Component',
133 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
135 return Civi
::$statics[__CLASS__
]['fields'];
139 * Return a mapping from field-name to the corresponding key (as used in fields()).
142 * Array(string $name => string $uniqueName).
144 public static function &fieldKeys() {
145 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
146 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
148 return Civi
::$statics[__CLASS__
]['fieldKeys'];
152 * Returns the names of this table
156 public static function getTableName() {
157 return self
::$_tableName;
161 * Returns if this table needs to be logged
165 public function getLog() {
170 * Returns the list of fields that can be imported
172 * @param bool $prefix
176 public static function &import($prefix = FALSE) {
177 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'component', $prefix, []);
182 * Returns the list of fields that can be exported
184 * @param bool $prefix
188 public static function &export($prefix = FALSE) {
189 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'component', $prefix, []);
194 * Returns the list of indices
196 * @param bool $localize
200 public static function indices($localize = TRUE) {
202 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;