5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/Component.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:b9121c01e72b5a9a2772dad9274f4549)
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
56 public function __construct() {
57 $this->__table
= 'civicrm_component';
58 parent
::__construct();
62 * Returns all the column names of this table
66 public static function &fields() {
67 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
68 Civi
::$statics[__CLASS__
]['fields'] = [
71 'type' => CRM_Utils_Type
::T_INT
,
72 'title' => ts('Component ID'),
73 'description' => ts('Component ID'),
75 'where' => 'civicrm_component.id',
76 'table_name' => 'civicrm_component',
77 'entity' => 'Component',
78 'bao' => 'CRM_Core_DAO_Component',
83 'type' => CRM_Utils_Type
::T_STRING
,
84 'title' => ts('Component name'),
85 'description' => ts('Name of the component.'),
88 'size' => CRM_Utils_Type
::BIG
,
89 'where' => 'civicrm_component.name',
90 'table_name' => 'civicrm_component',
91 'entity' => 'Component',
92 'bao' => 'CRM_Core_DAO_Component',
96 'name' => 'namespace',
97 'type' => CRM_Utils_Type
::T_STRING
,
98 'title' => ts('Namespace reserved for component.'),
99 'description' => ts('Path to components main directory in a form of a class
103 'size' => CRM_Utils_Type
::HUGE
,
104 'where' => 'civicrm_component.namespace',
105 'table_name' => 'civicrm_component',
106 'entity' => 'Component',
107 'bao' => 'CRM_Core_DAO_Component',
111 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
113 return Civi
::$statics[__CLASS__
]['fields'];
117 * Return a mapping from field-name to the corresponding key (as used in fields()).
120 * Array(string $name => string $uniqueName).
122 public static function &fieldKeys() {
123 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
124 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
126 return Civi
::$statics[__CLASS__
]['fieldKeys'];
130 * Returns the names of this table
134 public static function getTableName() {
135 return self
::$_tableName;
139 * Returns if this table needs to be logged
143 public function getLog() {
148 * Returns the list of fields that can be imported
150 * @param bool $prefix
154 public static function &import($prefix = FALSE) {
155 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'component', $prefix, []);
160 * Returns the list of fields that can be exported
162 * @param bool $prefix
166 public static function &export($prefix = FALSE) {
167 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'component', $prefix, []);
172 * Returns the list of indices
174 * @param bool $localize
178 public static function indices($localize = TRUE) {
180 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;