make common methods optimization

This commit is contained in:
ghost 2023-10-09 20:04:52 +03:00
parent 8d258c677b
commit 285a5104e2
10 changed files with 91 additions and 201 deletions

View file

@ -28,7 +28,11 @@ class UserService
// Return existing user
if ($result = $this->entityManagerInterface
->getRepository(User::class)
->findOneByAddressField($address))
->findOneBy(
[
'address' => $address
]
))
{
return $result;
}
@ -91,7 +95,7 @@ class UserService
{
return $this->entityManagerInterface
->getRepository(User::class)
->getUser($userId);
->find($userId);
}
public function identicon(
@ -128,7 +132,12 @@ class UserService
{
return $this->entityManagerInterface
->getRepository(UserStar::class)
->findUserStar($userId, $userIdTarget);
->findOneBy(
[
'userId' => $userId,
'userIdTarget' => $userIdTarget
]
);
}
public function findUserStarsTotalByUserIdTarget(int $torrentId): int