X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContribute%2FTokens.php;h=6569c6a72ee34146048117db326b0e4ba7be8f54;hb=11f2c79d9d08d946a0ed0c0ea817527be1fcf966;hp=ca1b952cc7fb842cfc24209b783d14d6f0c90d87;hpb=08a859c2d466a6f341c025a111ba41698d5083c8;p=civicrm-core.git diff --git a/CRM/Contribute/Tokens.php b/CRM/Contribute/Tokens.php index ca1b952cc7..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,61 +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 { - $fields = [ - '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', - 'cancel_reason', - 'amount_level', - 'check_number', - ]; - if (CRM_Campaign_BAO_Campaign::isCampaignEnable()) { - $fields[] = 'campaign_id'; - } - return $fields; - } - - /** - * 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']; } }