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:49336d40a24f0312944123741932dd25)
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',
102 'type' => CRM_Utils_Type
::T_STRING
,
103 'title' => ts('Mapping Name'),
104 'description' => ts('Name of Mapping'),
106 'size' => CRM_Utils_Type
::BIG
,
107 'where' => 'civicrm_mapping.name',
108 'table_name' => 'civicrm_mapping',
109 'entity' => 'Mapping',
110 'bao' => 'CRM_Core_BAO_Mapping',
115 'name' => 'description',
116 'type' => CRM_Utils_Type
::T_STRING
,
117 'title' => ts('Description'),
118 'description' => ts('Description of Mapping.'),
120 'size' => CRM_Utils_Type
::HUGE
,
121 'where' => 'civicrm_mapping.description',
122 'table_name' => 'civicrm_mapping',
123 'entity' => 'Mapping',
124 'bao' => 'CRM_Core_BAO_Mapping',
128 'mapping_type_id' => [
129 'name' => 'mapping_type_id',
130 'type' => CRM_Utils_Type
::T_INT
,
131 'title' => ts('Mapping Type'),
132 'description' => ts('Mapping Type'),
133 'where' => 'civicrm_mapping.mapping_type_id',
134 'table_name' => 'civicrm_mapping',
135 'entity' => 'Mapping',
136 'bao' => 'CRM_Core_BAO_Mapping',
141 'pseudoconstant' => [
142 'optionGroupName' => 'mapping_type',
143 'optionEditPath' => 'civicrm/admin/options/mapping_type',
148 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
150 return Civi
::$statics[__CLASS__
]['fields'];
154 * Return a mapping from field-name to the corresponding key (as used in fields()).
157 * Array(string $name => string $uniqueName).
159 public static function &fieldKeys() {
160 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
161 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
163 return Civi
::$statics[__CLASS__
]['fieldKeys'];
167 * Returns the names of this table
171 public static function getTableName() {
172 return self
::$_tableName;
176 * Returns if this table needs to be logged
180 public function getLog() {
185 * Returns the list of fields that can be imported
187 * @param bool $prefix
191 public static function &import($prefix = FALSE) {
192 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mapping', $prefix, []);
197 * Returns the list of fields that can be exported
199 * @param bool $prefix
203 public static function &export($prefix = FALSE) {
204 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mapping', $prefix, []);
209 * Returns the list of indices
211 * @param bool $localize
215 public static function indices($localize = TRUE) {
222 'localizable' => FALSE,
223 'sig' => 'civicrm_mapping::0::name',
226 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;