Merge pull request #14076 from seamuslee001/e2e_rest_test_get_admin_contact_id
[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 'where' => 'civicrm_mapping.id',
82 'table_name' => 'civicrm_mapping',
83 'entity' => 'Mapping',
84 'bao' => 'CRM_Core_BAO_Mapping',
85 'localizable' => 0,
86 ],
87 'name' => [
88 'name' => 'name',
89 'type' => CRM_Utils_Type::T_STRING,
90 'title' => ts('Name'),
91 'description' => ts('Name of Mapping'),
92 'maxlength' => 64,
93 'size' => CRM_Utils_Type::BIG,
94 'where' => 'civicrm_mapping.name',
95 'table_name' => 'civicrm_mapping',
96 'entity' => 'Mapping',
97 'bao' => 'CRM_Core_BAO_Mapping',
98 'localizable' => 0,
99 ],
100 'description' => [
101 'name' => 'description',
102 'type' => CRM_Utils_Type::T_STRING,
103 'title' => ts('Description'),
104 'description' => ts('Description of Mapping.'),
105 'maxlength' => 255,
106 'size' => CRM_Utils_Type::HUGE,
107 'where' => 'civicrm_mapping.description',
108 'table_name' => 'civicrm_mapping',
109 'entity' => 'Mapping',
110 'bao' => 'CRM_Core_BAO_Mapping',
111 'localizable' => 0,
112 ],
113 'mapping_type_id' => [
114 'name' => 'mapping_type_id',
115 'type' => CRM_Utils_Type::T_INT,
116 'title' => ts('Mapping Type'),
117 'description' => ts('Mapping Type'),
118 'where' => 'civicrm_mapping.mapping_type_id',
119 'table_name' => 'civicrm_mapping',
120 'entity' => 'Mapping',
121 'bao' => 'CRM_Core_BAO_Mapping',
122 'localizable' => 0,
123 'html' => [
124 'type' => 'Select',
125 ],
126 'pseudoconstant' => [
127 'optionGroupName' => 'mapping_type',
128 'optionEditPath' => 'civicrm/admin/options/mapping_type',
129 ]
130 ],
131 ];
132 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
133 }
134 return Civi::$statics[__CLASS__]['fields'];
135 }
136
137 /**
138 * Return a mapping from field-name to the corresponding key (as used in fields()).
139 *
140 * @return array
141 * Array(string $name => string $uniqueName).
142 */
143 public static function &fieldKeys() {
144 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
145 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
146 }
147 return Civi::$statics[__CLASS__]['fieldKeys'];
148 }
149
150 /**
151 * Returns the names of this table
152 *
153 * @return string
154 */
155 public static function getTableName() {
156 return self::$_tableName;
157 }
158
159 /**
160 * Returns if this table needs to be logged
161 *
162 * @return bool
163 */
164 public function getLog() {
165 return self::$_log;
166 }
167
168 /**
169 * Returns the list of fields that can be imported
170 *
171 * @param bool $prefix
172 *
173 * @return array
174 */
175 public static function &import($prefix = FALSE) {
176 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mapping', $prefix, []);
177 return $r;
178 }
179
180 /**
181 * Returns the list of fields that can be exported
182 *
183 * @param bool $prefix
184 *
185 * @return array
186 */
187 public static function &export($prefix = FALSE) {
188 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mapping', $prefix, []);
189 return $r;
190 }
191
192 /**
193 * Returns the list of indices
194 *
195 * @param bool $localize
196 *
197 * @return array
198 */
199 public static function indices($localize = TRUE) {
200 $indices = [
201 'UI_name' => [
202 'name' => 'UI_name',
203 'field' => [
204 0 => 'name',
205 ],
206 'localizable' => FALSE,
207 'sig' => 'civicrm_mapping::0::name',
208 ],
209 ];
210 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
211 }
212
213 }