mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Feature: [export] filter accompanying period which has no action - work
This commit is contained in:
@@ -12,10 +12,10 @@ declare(strict_types=1);
|
||||
namespace Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters;
|
||||
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use function in_array;
|
||||
|
||||
class HasNoActionFilter implements FilterInterface
|
||||
{
|
||||
@@ -24,13 +24,9 @@ class HasNoActionFilter implements FilterInterface
|
||||
return null;
|
||||
}
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
public function alterQuery(QueryBuilder $qb, $data): void
|
||||
{
|
||||
if (!in_array('acpw', $qb->getAllAliases(), true)) {
|
||||
$qb->join('acp.works', 'acpw');
|
||||
}
|
||||
|
||||
$qb->andWhere('COUNT(acp.works) IS NULL');
|
||||
$qb->andWhere('NOT EXISTS (SELECT 1 FROM ' . AccompanyingPeriodWork::class . ' work WHERE work.accompanyingPeriod = acp)');
|
||||
}
|
||||
|
||||
public function applyOn(): string
|
||||
@@ -38,7 +34,7 @@ class HasNoActionFilter implements FilterInterface
|
||||
return Declarations::ACP_TYPE;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
public function buildForm(FormBuilderInterface $builder): void
|
||||
{
|
||||
// no form
|
||||
}
|
||||
|
Reference in New Issue
Block a user