-
Notifications
You must be signed in to change notification settings - Fork 21
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
base: master
Are you sure you want to change the base?
Conversation
lib/Db/BookmarkMapper.php
Outdated
} | ||
|
||
return $this->findEntities($query); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you indent this function properly line 40-55 please?
lib/Db/PreferenceMapper.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removethe 4 empty lines here
remove 4 empty lines.
indent this function properly line 39-55.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fcki1984 Click on Commit suggestion
on each of my comments to fix the remaining whitespace issues.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); |
->andWhere($query->expr()->eq('user_id', $query->createNamedParameter($this->userId))); | ||
|
||
if (!empty($name)) { | ||
$query->andWhere($query->expr()->eq('name', $query->createNamedParameter($name))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$query->andWhere($query->expr()->eq('name', $query->createNamedParameter($name))); | |
$query->andWhere($query->expr()->eq('name', $query->createNamedParameter($name))); |
} | ||
|
||
return $this->findEntities($sql, $args); | ||
return $this->findEntities($query); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return $this->findEntities($query); | |
return $this->findEntities($query); |
@fcki1984 Bump |
Superseded by #50. |
Original PR: e-alfred#48 Fix error message: `Message: Class "OCP\AppFramework\Db\Mapper" not found` Co-authored-by: <[email protected]> Co-authored-by: Paul <[email protected]>
by chatgpt.