diff options
author | Vitor Mattos <vitor@php.rio> | 2022-01-10 10:27:00 -0300 |
---|---|---|
committer | Vitor Mattos <vitor@php.rio> | 2022-01-21 08:37:05 -0300 |
commit | 1dda03e1b59a2da7e9c08511120db20c825afeae (patch) | |
tree | 4df829a5461c1b020c4a7b601c364207466722cf /lib/private/Comments | |
parent | 9efbc9c1d533fb970a5cd89f154e3a4fb7ff882d (diff) | |
download | nextcloud-server-1dda03e1b59a2da7e9c08511120db20c825afeae.tar.gz nextcloud-server-1dda03e1b59a2da7e9c08511120db20c825afeae.zip |
Rename vars
Signed-off-by: Vitor Mattos <vitor@php.rio>
Diffstat (limited to 'lib/private/Comments')
-rw-r--r-- | lib/private/Comments/Manager.php | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/private/Comments/Manager.php b/lib/private/Comments/Manager.php index 7af905c43c9..599c4e106d7 100644 --- a/lib/private/Comments/Manager.php +++ b/lib/private/Comments/Manager.php @@ -909,13 +909,13 @@ class Manager implements ICommentsManager { return ($affectedRows > 0); } - private function deleteReaction(IComment $comment): void { + private function deleteReaction(IComment $reaction): void { $qb = $this->dbConn->getQueryBuilder(); $qb->delete('reactions') - ->where($qb->expr()->eq('parent_id', $qb->createNamedParameter($comment->getParentId()))) - ->andWhere($qb->expr()->eq('message_id', $qb->createNamedParameter($comment->getId()))) + ->where($qb->expr()->eq('parent_id', $qb->createNamedParameter($reaction->getParentId()))) + ->andWhere($qb->expr()->eq('message_id', $qb->createNamedParameter($reaction->getId()))) ->executeStatement(); - $this->sumReactions($comment); + $this->sumReactions($reaction->getParentId()); } /** @@ -1122,21 +1122,21 @@ class Manager implements ICommentsManager { return $affectedRows > 0; } - private function addReaction(IComment $comment): void { + private function addReaction(IComment $reaction): void { $qb = $this->dbConn->getQueryBuilder(); $qb->insert('reactions') ->values([ - 'parent_id' => $qb->createNamedParameter($comment->getParentId()), - 'message_id' => $qb->createNamedParameter($comment->getId()), - 'actor_type' => $qb->createNamedParameter($comment->getActorType()), - 'actor_id' => $qb->createNamedParameter($comment->getActorId()), - 'reaction' => $qb->createNamedParameter($comment->getMessage()), + 'parent_id' => $qb->createNamedParameter($reaction->getParentId()), + 'message_id' => $qb->createNamedParameter($reaction->getId()), + 'actor_type' => $qb->createNamedParameter($reaction->getActorType()), + 'actor_id' => $qb->createNamedParameter($reaction->getActorId()), + 'reaction' => $qb->createNamedParameter($reaction->getMessage()), ]) ->executeStatement(); - $this->sumReactions($comment); + $this->sumReactions($reaction->getParentId()); } - private function sumReactions(IComment $comment): void { + private function sumReactions(string $parentId): void { $qb = $this->dbConn->getQueryBuilder(); $totalQuery = $this->dbConn->getQueryBuilder(); @@ -1151,7 +1151,7 @@ class Manager implements ICommentsManager { 'total' ) ->from('reactions', 'r') - ->where($totalQuery->expr()->eq('r.parent_id', $qb->createNamedParameter($comment->getParentId()))) + ->where($totalQuery->expr()->eq('r.parent_id', $qb->createNamedParameter($parentId))) ->groupBy('r.reaction'); $jsonQuery = $this->dbConn->getQueryBuilder(); @@ -1169,7 +1169,7 @@ class Manager implements ICommentsManager { $qb ->update('comments') ->set('reactions', $jsonQuery->createFunction('(' . $jsonQuery->getSQL() . ')')) - ->where($qb->expr()->eq('id', $qb->createNamedParameter($comment->getParentId()))) + ->where($qb->expr()->eq('id', $qb->createNamedParameter($parentId))) ->executeStatement(); } |