mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
51 lines
1.3 KiB
PHP
51 lines
1.3 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace App\Repository;
|
||
|
|
||
|
use App\Entity\User;
|
||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||
|
use Symfony\Bridge\Doctrine\RegistryInterface;
|
||
|
|
||
|
/**
|
||
|
* @method User|null find($id, $lockMode = null, $lockVersion = null)
|
||
|
* @method User|null findOneBy(array $criteria, array $orderBy = null)
|
||
|
* @method User[] findAll()
|
||
|
* @method User[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||
|
*/
|
||
|
class UserRepository extends ServiceEntityRepository
|
||
|
{
|
||
|
public function __construct(RegistryInterface $registry)
|
||
|
{
|
||
|
parent::__construct($registry, User::class);
|
||
|
}
|
||
|
|
||
|
// /**
|
||
|
// * @return User[] Returns an array of User objects
|
||
|
// */
|
||
|
/*
|
||
|
public function findByExampleField($value)
|
||
|
{
|
||
|
return $this->createQueryBuilder('u')
|
||
|
->andWhere('u.exampleField = :val')
|
||
|
->setParameter('val', $value)
|
||
|
->orderBy('u.id', 'ASC')
|
||
|
->setMaxResults(10)
|
||
|
->getQuery()
|
||
|
->getResult()
|
||
|
;
|
||
|
}
|
||
|
*/
|
||
|
|
||
|
/*
|
||
|
public function findOneBySomeField($value): ?User
|
||
|
{
|
||
|
return $this->createQueryBuilder('u')
|
||
|
->andWhere('u.exampleField = :val')
|
||
|
->setParameter('val', $value)
|
||
|
->getQuery()
|
||
|
->getOneOrNullResult()
|
||
|
;
|
||
|
}
|
||
|
*/
|
||
|
}
|