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:1f7be99fb2d2adfebdf3faa2013666f4)
13 * Database access object for the Component entity.
15 class CRM_Core_DAO_Component
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_component';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
39 * Name of the component.
46 * Path to components main directory in a form of a class namespace.
55 public function __construct() {
56 $this->__table
= 'civicrm_component';
57 parent
::__construct();
61 * Returns localized title of this entity.
63 public static function getEntityTitle() {
64 return ts('Components');
68 * Returns all the column names of this table
72 public static function &fields() {
73 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
74 Civi
::$statics[__CLASS__
]['fields'] = [
77 'type' => CRM_Utils_Type
::T_INT
,
78 'title' => ts('Component ID'),
79 'description' => ts('Component ID'),
81 'where' => 'civicrm_component.id',
82 'table_name' => 'civicrm_component',
83 'entity' => 'Component',
84 'bao' => 'CRM_Core_DAO_Component',
90 'type' => CRM_Utils_Type
::T_STRING
,
91 'title' => ts('Component name'),
92 'description' => ts('Name of the component.'),
95 'size' => CRM_Utils_Type
::BIG
,
96 'where' => 'civicrm_component.name',
97 'table_name' => 'civicrm_component',
98 'entity' => 'Component',
99 'bao' => 'CRM_Core_DAO_Component',
104 'name' => 'namespace',
105 'type' => CRM_Utils_Type
::T_STRING
,
106 'title' => ts('Namespace reserved for component.'),
107 'description' => ts('Path to components main directory in a form of a class namespace.'),
109 'size' => CRM_Utils_Type
::HUGE
,
110 'where' => 'civicrm_component.namespace',
111 'table_name' => 'civicrm_component',
112 'entity' => 'Component',
113 'bao' => 'CRM_Core_DAO_Component',
118 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
120 return Civi
::$statics[__CLASS__
]['fields'];
124 * Return a mapping from field-name to the corresponding key (as used in fields()).
127 * Array(string $name => string $uniqueName).
129 public static function &fieldKeys() {
130 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
131 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
133 return Civi
::$statics[__CLASS__
]['fieldKeys'];
137 * Returns the names of this table
141 public static function getTableName() {
142 return self
::$_tableName;
146 * Returns if this table needs to be logged
150 public function getLog() {
155 * Returns the list of fields that can be imported
157 * @param bool $prefix
161 public static function &import($prefix = FALSE) {
162 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'component', $prefix, []);
167 * Returns the list of fields that can be exported
169 * @param bool $prefix
173 public static function &export($prefix = FALSE) {
174 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'component', $prefix, []);
179 * Returns the list of indices
181 * @param bool $localize
185 public static function indices($localize = TRUE) {
187 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;