(NFC) Set _log and _table_name variables to be public
[civicrm-core.git] / CRM / Core / DAO / Mapping.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2019
6 *
7 * Generated from xml/schema/CRM/Core/Mapping.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:26d8aa33c9340571c606aa5b8f085c1a)
10 */
11
12 /**
13 * Database access object for the Mapping entity.
14 */
15 class CRM_Core_DAO_Mapping extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_mapping';
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 * Mapping ID
33 *
34 * @var int unsigned
35 */
36 public $id;
37
38 /**
39 * Name of Mapping
40 *
41 * @var string
42 */
43 public $name;
44
45 /**
46 * Description of Mapping.
47 *
48 * @var string
49 */
50 public $description;
51
52 /**
53 * Mapping Type
54 *
55 * @var int unsigned
56 */
57 public $mapping_type_id;
58
59 /**
60 * Class constructor.
61 */
62 public function __construct() {
63 $this->__table = 'civicrm_mapping';
64 parent::__construct();
65 }
66
67 /**
68 * Returns all the column names of this table
69 *
70 * @return array
71 */
72 public static function &fields() {
73 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
74 Civi::$statics[__CLASS__]['fields'] = [
75 'id' => [
76 'name' => 'id',
77 'type' => CRM_Utils_Type::T_INT,
78 'title' => ts('Mapping ID'),
79 'description' => ts('Mapping ID'),
80 'required' => TRUE,
81 'table_name' => 'civicrm_mapping',
82 'entity' => 'Mapping',
83 'bao' => 'CRM_Core_BAO_Mapping',
84 'localizable' => 0,
85 ],
86 'name' => [
87 'name' => 'name',
88 'type' => CRM_Utils_Type::T_STRING,
89 'title' => ts('Name'),
90 'description' => ts('Name of Mapping'),
91 'maxlength' => 64,
92 'size' => CRM_Utils_Type::BIG,
93 'table_name' => 'civicrm_mapping',
94 'entity' => 'Mapping',
95 'bao' => 'CRM_Core_BAO_Mapping',
96 'localizable' => 0,
97 ],
98 'description' => [
99 'name' => 'description',
100 'type' => CRM_Utils_Type::T_STRING,
101 'title' => ts('Description'),
102 'description' => ts('Description of Mapping.'),
103 'maxlength' => 255,
104 'size' => CRM_Utils_Type::HUGE,
105 'table_name' => 'civicrm_mapping',
106 'entity' => 'Mapping',
107 'bao' => 'CRM_Core_BAO_Mapping',
108 'localizable' => 0,
109 ],
110 'mapping_type_id' => [
111 'name' => 'mapping_type_id',
112 'type' => CRM_Utils_Type::T_INT,
113 'title' => ts('Mapping Type'),
114 'description' => ts('Mapping Type'),
115 'table_name' => 'civicrm_mapping',
116 'entity' => 'Mapping',
117 'bao' => 'CRM_Core_BAO_Mapping',
118 'localizable' => 0,
119 'html' => [
120 'type' => 'Select',
121 ],
122 'pseudoconstant' => [
123 'optionGroupName' => 'mapping_type',
124 'optionEditPath' => 'civicrm/admin/options/mapping_type',
125 ]
126 ],
127 ];
128 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
129 }
130 return Civi::$statics[__CLASS__]['fields'];
131 }
132
133 /**
134 * Return a mapping from field-name to the corresponding key (as used in fields()).
135 *
136 * @return array
137 * Array(string $name => string $uniqueName).
138 */
139 public static function &fieldKeys() {
140 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
141 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
142 }
143 return Civi::$statics[__CLASS__]['fieldKeys'];
144 }
145
146 /**
147 * Returns the names of this table
148 *
149 * @return string
150 */
151 public static function getTableName() {
152 return self::$_tableName;
153 }
154
155 /**
156 * Returns if this table needs to be logged
157 *
158 * @return bool
159 */
160 public function getLog() {
161 return self::$_log;
162 }
163
164 /**
165 * Returns the list of fields that can be imported
166 *
167 * @param bool $prefix
168 *
169 * @return array
170 */
171 public static function &import($prefix = FALSE) {
172 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mapping', $prefix, []);
173 return $r;
174 }
175
176 /**
177 * Returns the list of fields that can be exported
178 *
179 * @param bool $prefix
180 *
181 * @return array
182 */
183 public static function &export($prefix = FALSE) {
184 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mapping', $prefix, []);
185 return $r;
186 }
187
188 /**
189 * Returns the list of indices
190 *
191 * @param bool $localize
192 *
193 * @return array
194 */
195 public static function indices($localize = TRUE) {
196 $indices = [
197 'UI_name' => [
198 'name' => 'UI_name',
199 'field' => [
200 0 => 'name',
201 ],
202 'localizable' => FALSE,
203 'sig' => 'civicrm_mapping::0::name',
204 ],
205 ];
206 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
207 }
208
209 }