Skip to content

Commit

Permalink
Manually query for the last id
Browse files Browse the repository at this point in the history
  • Loading branch information
nickvergessen committed Aug 19, 2015
1 parent 3951415 commit 0cd07d4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion apps/files_sharing/tests/api/shareestest.php
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,17 @@ protected function createShare($type, $with, $owner, $parent) {
])
->setParameter('expiration', null, 'datetime')
->execute();
return $connection->lastInsertId('share');

$queryBuilder = $connection->getQueryBuilder();
$query = $queryBuilder->select('id')
->from('share')
->orderBy('id', 'DESC')
->setMaxResults(1)
->execute();
$share = $query->fetch();
$query->closeCursor();

return (int) $share['id'];
}

/**
Expand Down

0 comments on commit 0cd07d4

Please sign in to comment.