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:7df1b2e6e35d3bbd5ae6d71f559cf8cb)
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 all the column names of this table
65 public static function &fields() {
66 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
67 Civi
::$statics[__CLASS__
]['fields'] = [
70 'type' => CRM_Utils_Type
::T_INT
,
71 'title' => ts('Component ID'),
72 'description' => ts('Component ID'),
74 'where' => 'civicrm_component.id',
75 'table_name' => 'civicrm_component',
76 'entity' => 'Component',
77 'bao' => 'CRM_Core_DAO_Component',
82 'type' => CRM_Utils_Type
::T_STRING
,
83 'title' => ts('Component name'),
84 'description' => ts('Name of the component.'),
87 'size' => CRM_Utils_Type
::BIG
,
88 'where' => 'civicrm_component.name',
89 'table_name' => 'civicrm_component',
90 'entity' => 'Component',
91 'bao' => 'CRM_Core_DAO_Component',
95 'name' => 'namespace',
96 'type' => CRM_Utils_Type
::T_STRING
,
97 'title' => ts('Namespace reserved for component.'),
98 'description' => ts('Path to components main directory in a form of a class namespace.'),
100 'size' => CRM_Utils_Type
::HUGE
,
101 'where' => 'civicrm_component.namespace',
102 'table_name' => 'civicrm_component',
103 'entity' => 'Component',
104 'bao' => 'CRM_Core_DAO_Component',
108 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
110 return Civi
::$statics[__CLASS__
]['fields'];
114 * Return a mapping from field-name to the corresponding key (as used in fields()).
117 * Array(string $name => string $uniqueName).
119 public static function &fieldKeys() {
120 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
121 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
123 return Civi
::$statics[__CLASS__
]['fieldKeys'];
127 * Returns the names of this table
131 public static function getTableName() {
132 return self
::$_tableName;
136 * Returns if this table needs to be logged
140 public function getLog() {
145 * Returns the list of fields that can be imported
147 * @param bool $prefix
151 public static function &import($prefix = FALSE) {
152 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'component', $prefix, []);
157 * Returns the list of fields that can be exported
159 * @param bool $prefix
163 public static function &export($prefix = FALSE) {
164 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'component', $prefix, []);
169 * Returns the list of indices
171 * @param bool $localize
175 public static function indices($localize = TRUE) {
177 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;