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
|
|
@ -20,24 +20,4 @@ class UserRepository extends ServiceEntityRepository
|
|||
{
|
||||
parent::__construct($registry, User::class);
|
||||
}
|
||||
|
||||
public function getUser(int $id): ?User
|
||||
{
|
||||
return $this->createQueryBuilder('u')
|
||||
->where('u.id = :id')
|
||||
->setParameter('id', $id)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
|
||||
public function findOneByAddressField(string $address): ?User
|
||||
{
|
||||
return $this->createQueryBuilder('u')
|
||||
->where('u.address = :address')
|
||||
->setParameter('address', $address)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue