getFieldValue($row, 'membership_type_id')); $row->tokens($entity, $field, \CRM_Utils_Money::formatLocaleNumericRoundedForDefaultCurrency($membershipType['minimum_fee'])); } else { parent::evaluateToken($row, $entity, $field, $prefetch); } } /** * Get fields which need to be returned to render another token. * * @return array */ public function getDependencies(): array { return ['fee' => 'membership_type_id']; } /** * Get any tokens with custom calculation. * * In this case 'fee' should be converted to{membership.membership_type_id.fee} * but we don't have the formatting support to do that with no * custom intervention yet. */ protected function getBespokeTokens(): array { return [ 'fee' => [ 'title' => ts('Membership Fee'), 'name' => 'fee', 'type' => 'calculated', 'options' => NULL, 'data_type' => 'integer', 'audience' => 'user', ], ]; } }