improve Extension Cache

This commit is contained in:
Marc Michalsky forumZFD 2021-02-08 13:58:48 +01:00
parent f3d242fce7
commit f6d46520cd
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9

View file

@ -82,11 +82,18 @@ class CRM_TwingleCampaign_Utils_ExtensionCache {
}
/**
* Returns a mapping of all custom field of the TwingleCampaign extension
* ## Get custom field mapping
* Returns a mapping custom fields of the TwingleCampaign extension.
* * If a **$fieldName** is provided, this method returns its custom field name
* * Without parameter, the method returns the whole mapping
* @param string|null $fieldName
*
* @return array
* @return array|string
*/
public function getCustomFieldMapping(): array {
public function getCustomFieldMapping(string $fieldName = NULL) {
if ($fieldName) {
return $this->customFieldMapping[$fieldName];
}
return $this->customFieldMapping;
}