5 * @copyright CiviCRM LLC (c) 2004-2017
7 * Generated from xml/schema/CRM/Core/Component.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:14ca0040d5a5656fd5dd91ad60a8ac89)
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 'description' => 'Component ID',
74 'table_name' => 'civicrm_component',
75 'entity' => 'Component',
76 'bao' => 'CRM_Core_DAO_Component',
81 'type' => CRM_Utils_Type
::T_STRING
,
82 'title' => ts('Component name'),
83 'description' => 'Name of the component.',
86 'size' => CRM_Utils_Type
::BIG
,
87 'table_name' => 'civicrm_component',
88 'entity' => 'Component',
89 'bao' => 'CRM_Core_DAO_Component',
93 'name' => 'namespace',
94 'type' => CRM_Utils_Type
::T_STRING
,
95 'title' => ts('Namespace reserved for component.'),
96 'description' => 'Path to components main directory in a form of a class
100 'size' => CRM_Utils_Type
::HUGE
,
101 'table_name' => 'civicrm_component',
102 'entity' => 'Component',
103 'bao' => 'CRM_Core_DAO_Component',
107 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
109 return Civi
::$statics[__CLASS__
]['fields'];
113 * Return a mapping from field-name to the corresponding key (as used in fields()).
116 * Array(string $name => string $uniqueName).
118 public static function &fieldKeys() {
119 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
120 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
122 return Civi
::$statics[__CLASS__
]['fieldKeys'];
126 * Returns the names of this table
130 public static function getTableName() {
131 return self
::$_tableName;
135 * Returns if this table needs to be logged
139 public function getLog() {
144 * Returns the list of fields that can be imported
146 * @param bool $prefix
150 public static function &import($prefix = FALSE) {
151 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'component', $prefix, []);
156 * Returns the list of fields that can be exported
158 * @param bool $prefix
162 public static function &export($prefix = FALSE) {
163 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'component', $prefix, []);
168 * Returns the list of indices
170 * @param bool $localize
174 public static function indices($localize = TRUE) {
176 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;