Merge pull request #13689 from eileenmcnaughton/no_record_payment
[civicrm-core.git] / CRM / Core / DAO / Component.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2019
6 *
7 * Generated from xml/schema/CRM/Core/Component.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:b9121c01e72b5a9a2772dad9274f4549)
10 */
11
12 /**
13 * Database access object for the Component entity.
14 */
15 class CRM_Core_DAO_Component extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_component';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 public static $_log = FALSE;
30
31 /**
32 * Component ID
33 *
34 * @var int unsigned
35 */
36 public $id;
37
38 /**
39 * Name of the component.
40 *
41 * @var string
42 */
43 public $name;
44
45 /**
46 * Path to components main directory in a form of a class
47 namespace.
48 *
49 * @var string
50 */
51 public $namespace;
52
53 /**
54 * Class constructor.
55 */
56 public function __construct() {
57 $this->__table = 'civicrm_component';
58 parent::__construct();
59 }
60
61 /**
62 * Returns all the column names of this table
63 *
64 * @return array
65 */
66 public static function &fields() {
67 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
68 Civi::$statics[__CLASS__]['fields'] = [
69 'id' => [
70 'name' => 'id',
71 'type' => CRM_Utils_Type::T_INT,
72 'title' => ts('Component ID'),
73 'description' => ts('Component ID'),
74 'required' => TRUE,
75 'where' => 'civicrm_component.id',
76 'table_name' => 'civicrm_component',
77 'entity' => 'Component',
78 'bao' => 'CRM_Core_DAO_Component',
79 'localizable' => 0,
80 ],
81 'name' => [
82 'name' => 'name',
83 'type' => CRM_Utils_Type::T_STRING,
84 'title' => ts('Component name'),
85 'description' => ts('Name of the component.'),
86 'required' => TRUE,
87 'maxlength' => 64,
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',
93 'localizable' => 0,
94 ],
95 'namespace' => [
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
100 namespace.
101 '),
102 'maxlength' => 128,
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',
108 'localizable' => 0,
109 ],
110 ];
111 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
112 }
113 return Civi::$statics[__CLASS__]['fields'];
114 }
115
116 /**
117 * Return a mapping from field-name to the corresponding key (as used in fields()).
118 *
119 * @return array
120 * Array(string $name => string $uniqueName).
121 */
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()));
125 }
126 return Civi::$statics[__CLASS__]['fieldKeys'];
127 }
128
129 /**
130 * Returns the names of this table
131 *
132 * @return string
133 */
134 public static function getTableName() {
135 return self::$_tableName;
136 }
137
138 /**
139 * Returns if this table needs to be logged
140 *
141 * @return bool
142 */
143 public function getLog() {
144 return self::$_log;
145 }
146
147 /**
148 * Returns the list of fields that can be imported
149 *
150 * @param bool $prefix
151 *
152 * @return array
153 */
154 public static function &import($prefix = FALSE) {
155 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'component', $prefix, []);
156 return $r;
157 }
158
159 /**
160 * Returns the list of fields that can be exported
161 *
162 * @param bool $prefix
163 *
164 * @return array
165 */
166 public static function &export($prefix = FALSE) {
167 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'component', $prefix, []);
168 return $r;
169 }
170
171 /**
172 * Returns the list of indices
173 *
174 * @param bool $localize
175 *
176 * @return array
177 */
178 public static function indices($localize = TRUE) {
179 $indices = [];
180 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
181 }
182
183 }