Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use QbMapper to replace the Mapper removed in nextcloud version 26.0.0 #48

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update BookmarkMapper.php
indent this function properly line 39-55.
fcki1984 authored May 12, 2023
commit 1ae0fad1eaf4e715c5b36fdec3763954db43391c
34 changes: 17 additions & 17 deletions lib/Db/BookmarkMapper.php
Original file line number Diff line number Diff line change
@@ -36,23 +36,23 @@ public function __construct(IDBConnection $db, $UserId, Time $time) {
* @param string $name
* @return array
*/
public function get($fileId, $name, $type = null) {
$query = $this->db->getQueryBuilder();
$query->select('*')
->from($this->getTableName())
->where($query->expr()->eq('file_id', $query->createNamedParameter($fileId)))
->andWhere($query->expr()->eq('user_id', $query->createNamedParameter($this->userId)));

if ($type !== null) {
$query->andWhere($query->expr()->eq('type', $query->createNamedParameter($type)));
}

if ($name !== null) {
$query->andWhere($query->expr()->eq('name', $query->createNamedParameter($name)));
}

return $this->findEntities($query);
}
public function get($fileId, $name, $type = null) {
$query = $this->db->getQueryBuilder();
$query->select('*')
->from($this->getTableName())
->where($query->expr()->eq('file_id', $query->createNamedParameter($fileId)))
->andWhere($query->expr()->eq('user_id', $query->createNamedParameter($this->userId)));

if ($type !== null) {
$query->andWhere($query->expr()->eq('type', $query->createNamedParameter($type)));
}

if ($name !== null) {
$query->andWhere($query->expr()->eq('name', $query->createNamedParameter($name)));
}

return $this->findEntities($query);
}

/**
* @brief write bookmark to database