You are here

function currency_test_install in Currency 8.3

Implements hook_install().

File

modules/currency_test/currency_test.install, line 30
Installation and uninstallation functionality.

Code

function currency_test_install() {
  $currency_codes = array(
    'EUR',
    'NLG',
    'USD',
    '',
  );
  $amounts = array(
    'amount_currency_code_definition' => 123.456,
    'amount_currency_code_field_definition' => 123.456,
    'amount_currency_code_field_table_definition' => 123.456,
    'amount_currency_undefined' => 123.456,
  );
  foreach ($currency_codes as $currency_code) {
    \Drupal::database()
      ->insert('currency_test')
      ->fields(array(
      'currency_code' => $currency_code,
    ) + $amounts)
      ->execute();
  }
}