$serializedData =
$this->
filterData($type,
$data,
$merge ?
$key : null
);
if (!
empty($data)) { $sql = '
INSERT INTO `s_core_translations` (
`objecttype`, `objectdata`, `objectkey`, `objectlanguage`, `dirty`
) VALUES (
:type, :data, :key, :language, 1
) ON DUPLICATE KEY UPDATE `objectdata`=VALUES(`objectdata`), `dirty` = 1;
';
$this->connection->
executeQuery( $sql,
[ ':type' =>
$type,
':data' =>
$serializedData,
':key' =>
$merge ? 1 :
$key,
':language' =>
$language,
] );
} else { $sql = '
DELETE FROM `s_core_translations`
WHERE `objecttype`= :type
AND `objectkey`= :key
AND `objectlanguage`= :language
';