private function addCurrency( Connection
$connection,
string
$id,
string
$isoCode,
float
$factor,
string
$symbol,
string
$shortNameDe,
string
$shortNameEn,
string
$nameDe,
string
$nameEn ): void
{ $languageDefault =
$this->
getEnLanguageId($connection);
$languageDE =
$this->
getDeLanguageId($connection);
$langId =
$connection->
fetchOne('
SELECT `currency`.`id` FROM `currency` WHERE `iso_code` = :code LIMIT 1
',
['code' =>
$isoCode]);
if (!
$langId) { $connection->
insert('currency',
['id' =>
$id, 'iso_code' =>
$isoCode, 'factor' =>
$factor, 'symbol' =>
$symbol, 'position' => 1, 'decimal_precision' => 2, 'created_at'
=> (new \
DateTime())->
format(Defaults::STORAGE_DATE_TIME_FORMAT
)]);
if ($languageDefault !==
$languageDE) { $connection->
insert('currency_translation',
['currency_id' =>
$id, 'language_id' =>
$languageDefault, 'short_name' =>
$shortNameEn, 'name' =>
$nameEn, 'created_at'
=> (new \
DateTime())->
format(Defaults::STORAGE_DATE_TIME_FORMAT
)]);
}