You are here

protected function Fields::getMoneyDefaults in Webform CiviCRM Integration 8.5

1 call to Fields::getMoneyDefaults()
Fields::wf_crm_get_fields in src/Fields.php

File

src/Fields.php, line 87

Class

Fields

Namespace

Drupal\webform_civicrm

Code

protected function getMoneyDefaults() : array {
  $utils = \Drupal::service('webform_civicrm.utils');
  return [
    'type' => 'number',
    'data_type' => 'Money',
    'extra' => [
      'field_prefix' => $utils
        ->wf_crm_get_civi_setting('defaultCurrencySymbol', '$'),
      'point' => $utils
        ->wf_crm_get_civi_setting('monetaryDecimalPoint', '.'),
      'separator' => $utils
        ->wf_crm_get_civi_setting('monetaryThousandSeparator', ','),
      'decimals' => 2,
      'min' => 0,
    ],
  ];
}