'is_multiple',
'icon',
];
- $current_db_version = CRM_Core_DAO::singleValueQuery("SELECT version FROM civicrm_domain WHERE id = " . CRM_Core_Config::domainID());
- $is_public_version = $current_db_version >= '4.7.19' ? 1 : 0;
+ $current_db_version = CRM_Core_BAO_Domain::version();
+ $is_public_version = version_compare($current_db_version, '4.7.19', '>=');
if ($is_public_version) {
$fields[] = 'is_public';
}
'time_format',
'option_group_id',
'in_selector',
- 'serialize',
],
'custom_group' => [
'id',
'max_multiple',
],
];
- $current_db_version = CRM_Core_DAO::singleValueQuery("SELECT version FROM civicrm_domain WHERE id = " . CRM_Core_Config::domainID());
- $is_public_version = $current_db_version >= '4.7.19' ? 1 : 0;
+ $current_db_version = CRM_Core_BAO_Domain::version();
+ $is_public_version = version_compare($current_db_version, '4.7.19', '>=');
+ $serialize_version = version_compare($current_db_version, '5.27.alpha1', '>=');
if ($is_public_version) {
$tableData['custom_group'][] = 'is_public';
}
+ if ($serialize_version) {
+ $tableData['custom_field'][] = 'serialize';
+ }
if (!$toReturn || !is_array($toReturn)) {
$toReturn = $tableData;
}
* @see _apachesolr_civiAttachments_dereference_file_parent
*/
public static function getTableNameByEntityName($entityType) {
- $tableName = '';
switch ($entityType) {
case 'Contact':
case 'Individual':
case 'Household':
case 'Organization':
- $tableName = 'civicrm_contact';
- break;
-
- case 'Contribution':
- $tableName = 'civicrm_contribution';
- break;
-
- case 'Group':
- $tableName = 'civicrm_group';
- break;
-
- // DRAFTING: Verify if we cannot make it pluggable
-
- case 'Activity':
- $tableName = 'civicrm_activity';
- break;
-
- case 'Relationship':
- $tableName = 'civicrm_relationship';
- break;
-
- case 'Membership':
- $tableName = 'civicrm_membership';
- break;
-
- case 'Participant':
- $tableName = 'civicrm_participant';
- break;
-
- case 'Event':
- $tableName = 'civicrm_event';
- break;
-
- case 'Grant':
- $tableName = 'civicrm_grant';
- break;
+ return 'civicrm_contact';
- // need to add cases for Location, Address
+ default:
+ return CRM_Core_DAO_AllCoreTables::getTableForEntityName($entityType);
}
-
- return $tableName;
}
/**