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:c69c9d834bfaaf44088ae0cd11e36b5f)
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;
36 * @var int|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
46 * (SQL type: varchar(64))
47 * Note that values will be retrieved from the database as a string.
52 * Description of Mapping.
55 * (SQL type: varchar(255))
56 * Note that values will be retrieved from the database as a string.
63 * @var int|string|null
64 * (SQL type: int unsigned)
65 * Note that values will be retrieved from the database as a string.
67 public $mapping_type_id;
72 public function __construct() {
73 $this->__table
= 'civicrm_mapping';
74 parent
::__construct();
78 * Returns localized title of this entity.
81 * Whether to return the plural version of the title.
83 public static function getEntityTitle($plural = FALSE) {
84 return $plural ?
ts('Mappings') : ts('Mapping');
88 * Returns all the column names of this table
92 public static function &fields() {
93 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
94 Civi
::$statics[__CLASS__
]['fields'] = [
97 'type' => CRM_Utils_Type
::T_INT
,
98 'title' => ts('Mapping ID'),
99 'description' => ts('Mapping ID'),
101 'where' => 'civicrm_mapping.id',
102 'table_name' => 'civicrm_mapping',
103 'entity' => 'Mapping',
104 'bao' => 'CRM_Core_BAO_Mapping',
114 'type' => CRM_Utils_Type
::T_STRING
,
115 'title' => ts('Mapping Name'),
116 'description' => ts('Name of Mapping'),
118 'size' => CRM_Utils_Type
::BIG
,
119 'where' => 'civicrm_mapping.name',
120 'table_name' => 'civicrm_mapping',
121 'entity' => 'Mapping',
122 'bao' => 'CRM_Core_BAO_Mapping',
127 'name' => 'description',
128 'type' => CRM_Utils_Type
::T_STRING
,
129 'title' => ts('Description'),
130 'description' => ts('Description of Mapping.'),
132 'size' => CRM_Utils_Type
::HUGE
,
133 'where' => 'civicrm_mapping.description',
134 'table_name' => 'civicrm_mapping',
135 'entity' => 'Mapping',
136 'bao' => 'CRM_Core_BAO_Mapping',
140 'mapping_type_id' => [
141 'name' => 'mapping_type_id',
142 'type' => CRM_Utils_Type
::T_INT
,
143 'title' => ts('Mapping Type'),
144 'description' => ts('Mapping Type'),
145 'where' => 'civicrm_mapping.mapping_type_id',
146 'table_name' => 'civicrm_mapping',
147 'entity' => 'Mapping',
148 'bao' => 'CRM_Core_BAO_Mapping',
153 'pseudoconstant' => [
154 'optionGroupName' => 'mapping_type',
155 'optionEditPath' => 'civicrm/admin/options/mapping_type',
160 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
162 return Civi
::$statics[__CLASS__
]['fields'];
166 * Return a mapping from field-name to the corresponding key (as used in fields()).
169 * Array(string $name => string $uniqueName).
171 public static function &fieldKeys() {
172 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
173 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
175 return Civi
::$statics[__CLASS__
]['fieldKeys'];
179 * Returns the names of this table
183 public static function getTableName() {
184 return self
::$_tableName;
188 * Returns if this table needs to be logged
192 public function getLog() {
197 * Returns the list of fields that can be imported
199 * @param bool $prefix
203 public static function &import($prefix = FALSE) {
204 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mapping', $prefix, []);
209 * Returns the list of fields that can be exported
211 * @param bool $prefix
215 public static function &export($prefix = FALSE) {
216 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mapping', $prefix, []);
221 * Returns the list of indices
223 * @param bool $localize
227 public static function indices($localize = TRUE) {
234 'localizable' => FALSE,
235 'sig' => 'civicrm_mapping::0::name',
238 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;