We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e27d7b1 commit 1358f4bCopy full SHA for 1358f4b
src/Infrastructure/Model/Repository/Sql/SqlWriteRepository.php
@@ -66,11 +66,22 @@ protected function updateQuery(Identity $value)
66
67
$this->populateQuery($query, $value, false);
68
69
- $query
+ $affectedRows = $query
70
->update($this->mapping->name())
71
->where($query->expr()->eq($this->mapping->identity(), ':id'))
72
->setParameter(':id', $value->id())
73
->execute();
74
+
75
+ if (0 === $affectedRows && false === $this->queryBuilder()->getConnection()->isTransactionActive()) {
76
+ throw new PDOException(
77
+ sprintf(
78
+ 'Could not update %s where %s = %s',
79
+ $this->mapping->name(),
80
+ $this->mapping->identity(),
81
+ $value->id()
82
+ )
83
+ );
84
+ }
85
}
86
87
/**
0 commit comments