X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContribute%2FTokens.php;h=6569c6a72ee34146048117db326b0e4ba7be8f54;hb=74b824c6bd3f7b29ffedb4dbbec424bac37e5c72;hp=e0aa7b2054eed8d7044cfd4438f04bbe6c89f9a8;hpb=7eb8aafe647632387c1f8b991ab9d035de9e656c;p=civicrm-core.git diff --git a/CRM/Contribute/Tokens.php b/CRM/Contribute/Tokens.php index e0aa7b2054..6569c6a72e 100644 --- a/CRM/Contribute/Tokens.php +++ b/CRM/Contribute/Tokens.php @@ -20,13 +20,6 @@ */ class CRM_Contribute_Tokens extends CRM_Core_EntityTokens { - /** - * @return string - */ - protected function getEntityName(): string { - return 'contribution'; - } - /** * @return string */ @@ -47,54 +40,10 @@ class CRM_Contribute_Tokens extends CRM_Core_EntityTokens { } /** - * Get a list of tokens for the entity for which access is permitted to. - * - * This list is historical and we need to question whether we - * should filter out any fields (other than those fields, like api_key - * on the contact entity) with permissions defined. - * * @return array */ - protected function getExposedFields(): array { - return [ - 'contribution_page_id', - 'source', - 'id', - 'receive_date', - 'total_amount', - 'fee_amount', - 'net_amount', - 'non_deductible_amount', - 'trxn_id', - 'invoice_id', - 'currency', - 'cancel_date', - 'receipt_date', - 'thankyou_date', - 'tax_amount', - 'contribution_status_id', - 'financial_type_id', - 'payment_instrument_id', - ]; - } - - /** - * Get tokens supporting the syntax we are migrating to. - * - * In general these are tokens that were not previously supported - * so we can add them in the preferred way or that we have - * undertaken some, as yet to be written, db update. - * - * See https://lab.civicrm.org/dev/core/-/issues/2650 - * - * @return string[] - */ - public function getBasicTokens(): array { - $return = []; - foreach ($this->getExposedFields() as $fieldName) { - $return[$fieldName] = $this->getFieldMetadata()[$fieldName]['title']; - } - return $return; + public function getCurrencyFieldName() { + return ['currency']; } }