Merge pull request #9680 from h-c-c/CRM-19881
[civicrm-core.git] / CRM / Core / DAO / Mapping.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2017
30 *
31 * Generated from xml/schema/CRM/Core/Mapping.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:87937c4e117abc8cd9ed04c2f054d26f)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 /**
38 * CRM_Core_DAO_Mapping constructor.
39 */
40 class CRM_Core_DAO_Mapping extends CRM_Core_DAO {
41 /**
42 * Static instance to hold the table name.
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_mapping';
47 /**
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
49 *
50 * @var boolean
51 */
52 static $_log = false;
53 /**
54 * Mapping ID
55 *
56 * @var int unsigned
57 */
58 public $id;
59 /**
60 * Name of Mapping
61 *
62 * @var string
63 */
64 public $name;
65 /**
66 * Description of Mapping.
67 *
68 * @var string
69 */
70 public $description;
71 /**
72 * Mapping Type
73 *
74 * @var int unsigned
75 */
76 public $mapping_type_id;
77 /**
78 * Class constructor.
79 */
80 function __construct() {
81 $this->__table = 'civicrm_mapping';
82 parent::__construct();
83 }
84 /**
85 * Returns all the column names of this table
86 *
87 * @return array
88 */
89 static function &fields() {
90 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
91 Civi::$statics[__CLASS__]['fields'] = array(
92 'id' => array(
93 'name' => 'id',
94 'type' => CRM_Utils_Type::T_INT,
95 'title' => ts('Mapping ID') ,
96 'description' => 'Mapping ID',
97 'required' => true,
98 'table_name' => 'civicrm_mapping',
99 'entity' => 'Mapping',
100 'bao' => 'CRM_Core_BAO_Mapping',
101 ) ,
102 'name' => array(
103 'name' => 'name',
104 'type' => CRM_Utils_Type::T_STRING,
105 'title' => ts('Name') ,
106 'description' => 'Name of Mapping',
107 'maxlength' => 64,
108 'size' => CRM_Utils_Type::BIG,
109 'table_name' => 'civicrm_mapping',
110 'entity' => 'Mapping',
111 'bao' => 'CRM_Core_BAO_Mapping',
112 ) ,
113 'description' => array(
114 'name' => 'description',
115 'type' => CRM_Utils_Type::T_STRING,
116 'title' => ts('Description') ,
117 'description' => 'Description of Mapping.',
118 'maxlength' => 255,
119 'size' => CRM_Utils_Type::HUGE,
120 'table_name' => 'civicrm_mapping',
121 'entity' => 'Mapping',
122 'bao' => 'CRM_Core_BAO_Mapping',
123 ) ,
124 'mapping_type_id' => array(
125 'name' => 'mapping_type_id',
126 'type' => CRM_Utils_Type::T_INT,
127 'title' => ts('Mapping Type') ,
128 'description' => 'Mapping Type',
129 'table_name' => 'civicrm_mapping',
130 'entity' => 'Mapping',
131 'bao' => 'CRM_Core_BAO_Mapping',
132 'html' => array(
133 'type' => 'Select',
134 ) ,
135 'pseudoconstant' => array(
136 'optionGroupName' => 'mapping_type',
137 'optionEditPath' => 'civicrm/admin/options/mapping_type',
138 )
139 ) ,
140 );
141 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
142 }
143 return Civi::$statics[__CLASS__]['fields'];
144 }
145 /**
146 * Return a mapping from field-name to the corresponding key (as used in fields()).
147 *
148 * @return array
149 * Array(string $name => string $uniqueName).
150 */
151 static function &fieldKeys() {
152 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
153 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
154 }
155 return Civi::$statics[__CLASS__]['fieldKeys'];
156 }
157 /**
158 * Returns the names of this table
159 *
160 * @return string
161 */
162 static function getTableName() {
163 return self::$_tableName;
164 }
165 /**
166 * Returns if this table needs to be logged
167 *
168 * @return boolean
169 */
170 function getLog() {
171 return self::$_log;
172 }
173 /**
174 * Returns the list of fields that can be imported
175 *
176 * @param bool $prefix
177 *
178 * @return array
179 */
180 static function &import($prefix = false) {
181 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mapping', $prefix, array());
182 return $r;
183 }
184 /**
185 * Returns the list of fields that can be exported
186 *
187 * @param bool $prefix
188 *
189 * @return array
190 */
191 static function &export($prefix = false) {
192 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mapping', $prefix, array());
193 return $r;
194 }
195 }