mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 01:25:39 +00:00
make common methods optimization
This commit is contained in:
parent
8d258c677b
commit
285a5104e2
10 changed files with 91 additions and 201 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue