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

Conversation

fcki1984
Copy link

by chatgpt.

}

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

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?

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

fcki1984 added 3 commits May 12, 2023 21:48
remove 4 empty lines.
indent this function properly line 39-55.
Copy link

@devnoname120 devnoname120 left a 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.

Comment on lines +39 to +54
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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return $this->findEntities($query);
return $this->findEntities($query);

@devnoname120
Copy link

@fcki1984 Bump

@devnoname120
Copy link

Superseded by #50.

devnoname120 added a commit to devnoname120/epubviewer that referenced this pull request Jul 30, 2023
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants