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:a5136517000cfab182cdacc3130bc29c)
13 * Database access object for the Component entity.
15 class CRM_Core_DAO_Component
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '2.0';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_component';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
41 * Name of the component.
48 * Path to components main directory in a form of a class namespace.
57 public function __construct() {
58 $this->__table
= 'civicrm_component';
59 parent
::__construct();
63 * Returns localized title of this entity.
66 * Whether to return the plural version of the title.
68 public static function getEntityTitle($plural = FALSE) {
69 return $plural ?
ts('Components') : ts('Component');
73 * Returns all the column names of this table
77 public static function &fields() {
78 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
79 Civi
::$statics[__CLASS__
]['fields'] = [
82 'type' => CRM_Utils_Type
::T_INT
,
83 'title' => ts('Component ID'),
84 'description' => ts('Component ID'),
86 'where' => 'civicrm_component.id',
87 'table_name' => 'civicrm_component',
88 'entity' => 'Component',
89 'bao' => 'CRM_Core_DAO_Component',
95 'type' => CRM_Utils_Type
::T_STRING
,
96 'title' => ts('Component name'),
97 'description' => ts('Name of the component.'),
100 'size' => CRM_Utils_Type
::BIG
,
101 'where' => 'civicrm_component.name',
102 'table_name' => 'civicrm_component',
103 'entity' => 'Component',
104 'bao' => 'CRM_Core_DAO_Component',
109 'name' => 'namespace',
110 'type' => CRM_Utils_Type
::T_STRING
,
111 'title' => ts('Namespace reserved for component.'),
112 'description' => ts('Path to components main directory in a form of a class namespace.'),
114 'size' => CRM_Utils_Type
::HUGE
,
115 'where' => 'civicrm_component.namespace',
116 'table_name' => 'civicrm_component',
117 'entity' => 'Component',
118 'bao' => 'CRM_Core_DAO_Component',
123 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
125 return Civi
::$statics[__CLASS__
]['fields'];
129 * Return a mapping from field-name to the corresponding key (as used in fields()).
132 * Array(string $name => string $uniqueName).
134 public static function &fieldKeys() {
135 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
136 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
138 return Civi
::$statics[__CLASS__
]['fieldKeys'];
142 * Returns the names of this table
146 public static function getTableName() {
147 return self
::$_tableName;
151 * Returns if this table needs to be logged
155 public function getLog() {
160 * Returns the list of fields that can be imported
162 * @param bool $prefix
166 public static function &import($prefix = FALSE) {
167 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'component', $prefix, []);
172 * Returns the list of fields that can be exported
174 * @param bool $prefix
178 public static function &export($prefix = FALSE) {
179 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'component', $prefix, []);
184 * Returns the list of indices
186 * @param bool $localize
190 public static function indices($localize = TRUE) {
192 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;