Merge pull request #13086 from nextcloud/bugfix/dont-query-when-id-not-null

Fetch lastInsertId only when id null
This commit is contained in:
Roeland Jago Douma 2018-12-27 10:02:15 +01:00 committed by GitHub
commit bb3a7ad275
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}