5 * @copyright CiviCRM LLC (c) 2004-2018
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 static $_tableName = 'civicrm_component';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 '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 'table_name' => 'civicrm_component',
89 'entity' => 'Component',
90 'bao' => 'CRM_Core_DAO_Component',
94 'name' => 'namespace',
95 'type' => CRM_Utils_Type
::T_STRING
,
96 'title' => ts('Namespace reserved for component.'),
97 'description' => ts('Path to components main directory in a form of a class
101 'size' => CRM_Utils_Type
::HUGE
,
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;