TaskSchema module

This commit is contained in:
Marek Lenczewski
2026-04-12 15:42:48 +02:00
parent 4e81cea831
commit 5198769de4
57 changed files with 3066 additions and 324 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace App\Repository;
use App\Collection\TaskSchemaCollection;
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);
}
public function allSchemas(): TaskSchemaCollection
{
return new TaskSchemaCollection(parent::findAll());
}
/** @return list<TaskSchema> */
public function findActiveWithRepeat(): array
{
return $this->createQueryBuilder('s')
->andWhere('s.status = :status')
->andWhere('s.repeat IS NOT NULL')
->setParameter('status', TaskSchemaStatus::Active)
->getQuery()
->getResult();
}
}