current init

This commit is contained in:
Marek
2026-03-30 15:42:44 +02:00
parent c5229e48ed
commit 2f96caaa23
366 changed files with 6093 additions and 11029 deletions

View File

@@ -0,0 +1,39 @@
<?php
namespace App\Repository;
use App\Entity\TaskSchema;
use App\Enum\TaskSchemaStatus;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<TaskSchema>
*/
class TaskSchemaRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, TaskSchema::class);
}
/**
* @return TaskSchema[]
*/
public function findActiveTasksInRange(\DateTimeInterface $from, \DateTimeInterface $to): array
{
return $this->createQueryBuilder('t')
->where('t.status != :excluded')
->andWhere(
'(t.taskType = :einzel AND (t.deadline IS NULL OR (t.deadline >= :from AND t.deadline <= :to)))'
. ' OR '
. '(t.taskType != :einzel AND t.startDate <= :to AND (t.endDate IS NULL OR t.endDate >= :from))'
)
->setParameter('excluded', TaskSchemaStatus::Inactive)
->setParameter('einzel', 'einzel')
->setParameter('from', $from)
->setParameter('to', $to)
->getQuery()
->getResult();
}
}