Skip to content

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/epubreader#48

Fix error message: `Message: Class "OCP\AppFramework\Db\Mapper" not found`

Co-authored-by: <39592566+fcki1984@users.noreply.github.com>
Co-authored-by: Paul <devnoname120@gmail.com>
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