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:fd26fa740989a13ac1d91618c2059d57)
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.
66 * Whether to return the plural version of the title.
68 public static function getEntityTitle($plural = FALSE) {
69 return $plural ?
ts('Components') : ts('Component');
73 * Returns all the column names of this table
77 public static function &fields() {
78 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
79 Civi
::$statics[__CLASS__
]['fields'] = [
82 'type' => CRM_Utils_Type
::T_INT
,
83 'title' => ts('Component ID'),
84 'description' => ts('Component ID'),
86 'where' => 'civicrm_component.id',
87 'table_name' => 'civicrm_component',
88 'entity' => 'Component',
89 'bao' => 'CRM_Core_DAO_Component',
99 'type' => CRM_Utils_Type
::T_STRING
,
100 'title' => ts('Component name'),
101 'description' => ts('Name of the component.'),
104 'size' => CRM_Utils_Type
::BIG
,
105 'where' => 'civicrm_component.name',
106 'table_name' => 'civicrm_component',
107 'entity' => 'Component',
108 'bao' => 'CRM_Core_DAO_Component',
113 'name' => 'namespace',
114 'type' => CRM_Utils_Type
::T_STRING
,
115 'title' => ts('Namespace reserved for component.'),
116 'description' => ts('Path to components main directory in a form of a class namespace.'),
118 'size' => CRM_Utils_Type
::HUGE
,
119 'where' => 'civicrm_component.namespace',
120 'table_name' => 'civicrm_component',
121 'entity' => 'Component',
122 'bao' => 'CRM_Core_DAO_Component',
127 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
129 return Civi
::$statics[__CLASS__
]['fields'];
133 * Return a mapping from field-name to the corresponding key (as used in fields()).
136 * Array(string $name => string $uniqueName).
138 public static function &fieldKeys() {
139 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
140 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
142 return Civi
::$statics[__CLASS__
]['fieldKeys'];
146 * Returns the names of this table
150 public static function getTableName() {
151 return self
::$_tableName;
155 * Returns if this table needs to be logged
159 public function getLog() {
164 * Returns the list of fields that can be imported
166 * @param bool $prefix
170 public static function &import($prefix = FALSE) {
171 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'component', $prefix, []);
176 * Returns the list of fields that can be exported
178 * @param bool $prefix
182 public static function &export($prefix = FALSE) {
183 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'component', $prefix, []);
188 * Returns the list of indices
190 * @param bool $localize
194 public static function indices($localize = TRUE) {
196 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;