feat: filter assignments and applications by teamer name

closes #869b9vgq7
This commit is contained in:
Björn Fromme
2026-03-15 12:42:28 +01:00
parent e45f6458d4
commit ed41d40059
10 changed files with 105 additions and 6 deletions
+14
View File
@@ -7,6 +7,7 @@ use App\Entity\Assignment;
use App\Entity\Teamer;
use App\Model\ApplicationFilterDto;
use App\Model\AssignmentFilterDto;
use App\Repository\Traits\QueryHelperTrait;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\Query;
use Doctrine\Persistence\ManagerRegistry;
@@ -21,6 +22,8 @@ use Doctrine\Persistence\ManagerRegistry;
*/
class ApplicationRepository extends ServiceEntityRepository
{
use QueryHelperTrait;
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Application::class);
@@ -109,6 +112,17 @@ class ApplicationRepository extends ServiceEntityRepository
;
}
$teamerName = $filterDto->getTeamerName();
if (null !== $teamerName && '' !== trim($teamerName)) {
$qb
->andWhere($qb->expr()->orX(
$qb->expr()->like('user.firstName', ':teamerName'),
$qb->expr()->like('user.lastName', ':teamerName')
))
->setParameter('teamerName', '%'.$this->escapeLikeWildcards($teamerName).'%')
;
}
return $qb->getQuery();
}