Merge pull request #185 from nextcloud/do-not-need-last-inserted-id

removing useless getLastInsertId()
pull/193/head
Roeland Jago Douma 2018-12-10 21:30:00 +01:00 zatwierdzone przez GitHub
commit 35117b541a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 2 dodań i 10 usunięć

Wyświetl plik

@ -62,10 +62,8 @@ class CacheActorsRequest extends CacheActorsRequestBuilder {
* insert cache about an Actor in database.
*
* @param Person $actor
*
* @return int
*/
public function save(Person $actor): int {
public function save(Person $actor) {
$qb = $this->getCacheActorsInsertSql();
$qb->setValue('id', $qb->createNamedParameter($actor->getId()))
->setValue('account', $qb->createNamedParameter($actor->getAccount()))
@ -101,8 +99,6 @@ class CacheActorsRequest extends CacheActorsRequestBuilder {
$qb->setValue('icon_id', $qb->createNamedParameter($iconId));
$qb->execute();
return $qb->getLastInsertId();
}

Wyświetl plik

@ -61,10 +61,8 @@ class NotesRequest extends NotesRequestBuilder {
* Insert a new Note in the database.
*
* @param Note $note
*
* @return int
*/
public function save(Note $note): int {
public function save(Note $note) {
$dTime = new DateTime();
$dTime->setTimestamp($note->getPublishedTime());
@ -108,8 +106,6 @@ class NotesRequest extends NotesRequestBuilder {
);
$qb->execute();
return $qb->getLastInsertId();
}