Skip to content

Commit

Permalink
Merge branch '5.0' into 5.1
Browse files Browse the repository at this point in the history
* 5.0:
  [Cache] Use the default expiry when saving (not when creating) items
  Fix typo
  Fix DBAL deprecation
  [Form] Fix ChoiceType translation domain
  Add Tagalog translations for new form messages
  [Form] Add missing vietnamese translations
  sync translations from master
  [OptionsResolver] Fix force prepend normalizer
  add vietnamese translation for html5 color validation
  • Loading branch information
nicolas-grekas committed Jul 12, 2020
1 parent 4c9693c commit d864839
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Transport/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function send(string $body, array $headers, int $delay = 0): string
'available_at' => '?',
]);

$this->executeUpdate($queryBuilder->getSQL(), [
$this->executeStatement($queryBuilder->getSQL(), [
$body,
json_encode($headers),
$this->configuration['queue_name'],
Expand Down Expand Up @@ -194,7 +194,7 @@ public function get(): ?array
->set('delivered_at', '?')
->where('id = ?');
$now = new \DateTime();
$this->executeUpdate($queryBuilder->getSQL(), [
$this->executeStatement($queryBuilder->getSQL(), [
$now,
$doctrineEnvelope['id'],
], [
Expand Down Expand Up @@ -369,10 +369,14 @@ private function executeQuery(string $sql, array $parameters = [], array $types
return $stmt;
}

private function executeUpdate(string $sql, array $parameters = [], array $types = [])
private function executeStatement(string $sql, array $parameters = [], array $types = [])
{
try {
$stmt = $this->driverConnection->executeUpdate($sql, $parameters, $types);
if (method_exists($this->driverConnection, 'executeStatement')) {
$stmt = $this->driverConnection->executeStatement($sql, $parameters, $types);
} else {
$stmt = $this->driverConnection->executeUpdate($sql, $parameters, $types);
}
} catch (TableNotFoundException $e) {
if ($this->driverConnection->isTransactionActive()) {
throw $e;
Expand All @@ -382,7 +386,11 @@ private function executeUpdate(string $sql, array $parameters = [], array $types
if ($this->autoSetup) {
$this->setup();
}
$stmt = $this->driverConnection->executeUpdate($sql, $parameters, $types);
if (method_exists($this->driverConnection, 'executeStatement')) {
$stmt = $this->driverConnection->executeStatement($sql, $parameters, $types);
} else {
$stmt = $this->driverConnection->executeUpdate($sql, $parameters, $types);
}
}

return $stmt;
Expand Down

0 comments on commit d864839

Please sign in to comment.