diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2018-12-27 10:02:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-27 10:02:15 +0100 |
commit | bb3a7ad27517259a6d581fb4398d0040ad5646ce (patch) | |
tree | 58f7ace26a0b89937f29b503bc45c25f155fe0a0 /lib | |
parent | 1c3f468d569062d86c50928761950a5b1f59c720 (diff) | |
parent | 8a952b73d65d332832c3468e1c6af5108b80bc83 (diff) | |
download | nextcloud-server-bb3a7ad27517259a6d581fb4398d0040ad5646ce.tar.gz nextcloud-server-bb3a7ad27517259a6d581fb4398d0040ad5646ce.zip |
Merge pull request #13086 from nextcloud/bugfix/dont-query-when-id-not-null
Fetch lastInsertId only when id null
Diffstat (limited to 'lib')
-rw-r--r-- | lib/public/AppFramework/Db/QBMapper.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/public/AppFramework/Db/QBMapper.php b/lib/public/AppFramework/Db/QBMapper.php index dbc47d2d43d..a6a44b8902e 100644 --- a/lib/public/AppFramework/Db/QBMapper.php +++ b/lib/public/AppFramework/Db/QBMapper.php @@ -119,7 +119,9 @@ abstract class QBMapper { $qb->execute(); - $entity->setId((int) $qb->getLastInsertId()); + if($entity->id === null) { + $entity->setId((int)$qb->getLastInsertId()); + } return $entity; } |