minor changes

This commit is contained in:
Marc Michalsky 2023-08-03 15:05:34 +02:00
parent c3f4db8600
commit a868e87ba7
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9

View file

@ -52,8 +52,6 @@ class CRM_Twingle_Profile {
/** /**
* Logs (production) access to this profile * Logs (production) access to this profile
*
* @return bool
*/ */
public function logAccess() { public function logAccess() {
CRM_Core_DAO::executeQuery(" CRM_Core_DAO::executeQuery("
@ -90,7 +88,7 @@ class CRM_Twingle_Profile {
$custom_field_mapping = []; $custom_field_mapping = [];
if (!empty($custom_field_definition = $this->getAttribute('custom_field_mapping'))) { if (!empty($custom_field_definition = $this->getAttribute('custom_field_mapping'))) {
foreach (preg_split('/\r\n|\r|\n/', $custom_field_definition, -1, PREG_SPLIT_NO_EMPTY) as $custom_field_map) { foreach (preg_split('/\r\n|\r|\n/', $custom_field_definition, -1, PREG_SPLIT_NO_EMPTY) as $custom_field_map) {
list($twingle_field_name, $custom_field_name) = explode("=", $custom_field_map); [$twingle_field_name, $custom_field_name] = explode("=", $custom_field_map);
$custom_field_mapping[$twingle_field_name] = $custom_field_name; $custom_field_mapping[$twingle_field_name] = $custom_field_name;
} }
} }
@ -133,12 +131,7 @@ class CRM_Twingle_Profile {
* @return mixed | NULL * @return mixed | NULL
*/ */
public function getAttribute($attribute_name, $default = NULL) { public function getAttribute($attribute_name, $default = NULL) {
if (isset($this->data[$attribute_name])) { return $this->data[$attribute_name] ?? $default;
return $this->data[$attribute_name];
}
else {
return $default;
}
} }
/** /**