src/RunOpenCode/ExchangeRate/Repository/DoctrineDbalRepository.php
public function delete(array $rates)
    {
        $this->connection->beginTransaction();

        try {

            /**
             * @var RateInterface $rate
             */
            foreach ($rates as $rate) {
                $key = $this->getRateKey($rate->getCurrencyCode(), $rate->getDate(), $rate->getRateType(), $rate->getSourceName());

                if (isset($this->identityMap[$key])) {
                    unset($this->identityMap[$key]);
                }

                $this->connection->executeQuery(sprintf('DELETE FROM %s WHERE source_name = :source_name AND currency_code = :currency_code AND rate_date = :rate_date AND rate_type = :rate_type;', $this->tableName), [
                    'source_name'   => $rate->getSourceName(),
                    'currency_code' => $rate->getCurrencyCode(),
                    'rate_date'     => $rate->getDate()->format('Y-m-d'),
                    'rate_type'     => $rate->getRateType(),
                ]);
            }

            $this->connection->commit();
        } catch (\Exception $e) {
            $this->connection->rollBack();
            throw new ExchangeRateException('Unable to delete rates.', 0, $e);
        }
    }
public function delete(array $rates)
    {
        $this->connection->beginTransaction();

        try {

            /**
             * @var RateInterface $rate
             */
            foreach ($rates as $rate) {
                $key = $this->getRateKey($rate->getCurrencyCode(), $rate->getDate(), $rate->getRateType(), $rate->getSourceName());

                if (isset($this->identityMap[$key])) {
                    unset($this->identityMap[$key]);
                }

                $this->connection->executeQuery(sprintf('DELETE FROM %s WHERE source_name = :source_name AND currency_code = :currency_code AND rate_date = :rate_date AND rate_type = :rate_type;', $this->tableName), [
                    'source_name'   => $rate->getSourceName(),
                    'currency_code' => $rate->getCurrencyCode(),
                    'rate_date'     => $rate->getDate()->format('Y-m-d'),
                    'rate_type'     => $rate->getRateType(),
                ]);
            }

            $this->connection->commit();
        } catch (\Exception $e) {
            $this->connection->rollBack();
            throw new ExchangeRateException('Unable to delete rates.', 0, $e);
        }
    }
{@inheritdoc}