5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/Mapping.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:4a0976e14e588b9a81c79e72849494e0)
13 * Database access object for the Mapping entity.
15 class CRM_Core_DAO_Mapping
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.2';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_mapping';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
48 * Description of Mapping.
59 public $mapping_type_id;
64 public function __construct() {
65 $this->__table
= 'civicrm_mapping';
66 parent
::__construct();
70 * Returns localized title of this entity.
73 * Whether to return the plural version of the title.
75 public static function getEntityTitle($plural = FALSE) {
76 return $plural ?
ts('Mappings') : ts('Mapping');
80 * Returns all the column names of this table
84 public static function &fields() {
85 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
86 Civi
::$statics[__CLASS__
]['fields'] = [
89 'type' => CRM_Utils_Type
::T_INT
,
90 'title' => ts('Mapping ID'),
91 'description' => ts('Mapping ID'),
93 'where' => 'civicrm_mapping.id',
94 'table_name' => 'civicrm_mapping',
95 'entity' => 'Mapping',
96 'bao' => 'CRM_Core_BAO_Mapping',
106 'type' => CRM_Utils_Type
::T_STRING
,
107 'title' => ts('Mapping Name'),
108 'description' => ts('Name of Mapping'),
110 'size' => CRM_Utils_Type
::BIG
,
111 'where' => 'civicrm_mapping.name',
112 'table_name' => 'civicrm_mapping',
113 'entity' => 'Mapping',
114 'bao' => 'CRM_Core_BAO_Mapping',
119 'name' => 'description',
120 'type' => CRM_Utils_Type
::T_STRING
,
121 'title' => ts('Description'),
122 'description' => ts('Description of Mapping.'),
124 'size' => CRM_Utils_Type
::HUGE
,
125 'where' => 'civicrm_mapping.description',
126 'table_name' => 'civicrm_mapping',
127 'entity' => 'Mapping',
128 'bao' => 'CRM_Core_BAO_Mapping',
132 'mapping_type_id' => [
133 'name' => 'mapping_type_id',
134 'type' => CRM_Utils_Type
::T_INT
,
135 'title' => ts('Mapping Type'),
136 'description' => ts('Mapping Type'),
137 'where' => 'civicrm_mapping.mapping_type_id',
138 'table_name' => 'civicrm_mapping',
139 'entity' => 'Mapping',
140 'bao' => 'CRM_Core_BAO_Mapping',
145 'pseudoconstant' => [
146 'optionGroupName' => 'mapping_type',
147 'optionEditPath' => 'civicrm/admin/options/mapping_type',
152 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
154 return Civi
::$statics[__CLASS__
]['fields'];
158 * Return a mapping from field-name to the corresponding key (as used in fields()).
161 * Array(string $name => string $uniqueName).
163 public static function &fieldKeys() {
164 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
165 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
167 return Civi
::$statics[__CLASS__
]['fieldKeys'];
171 * Returns the names of this table
175 public static function getTableName() {
176 return self
::$_tableName;
180 * Returns if this table needs to be logged
184 public function getLog() {
189 * Returns the list of fields that can be imported
191 * @param bool $prefix
195 public static function &import($prefix = FALSE) {
196 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mapping', $prefix, []);
201 * Returns the list of fields that can be exported
203 * @param bool $prefix
207 public static function &export($prefix = FALSE) {
208 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mapping', $prefix, []);
213 * Returns the list of indices
215 * @param bool $localize
219 public static function indices($localize = TRUE) {
226 'localizable' => FALSE,
227 'sig' => 'civicrm_mapping::0::name',
230 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;