mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
acp HasNoAction Filter (UNTESTED)
This commit is contained in:
@@ -25,11 +25,11 @@ class HasNoActionFilter implements FilterInterface
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
$qb
|
||||
->andWhere(
|
||||
$qb->expr()->in('', ':')
|
||||
)
|
||||
->setParameter('', $data[]);
|
||||
if (!in_array('acpw', $qb->getAllAliases(), true)) {
|
||||
$qb->join('acp.works', 'acpw');
|
||||
}
|
||||
|
||||
$qb->andWhere('COUNT(acp.works) IS NULL');
|
||||
}
|
||||
|
||||
public function applyOn(): string
|
||||
@@ -39,13 +39,12 @@ class HasNoActionFilter implements FilterInterface
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
$builder->add();
|
||||
// no form
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string'): array
|
||||
{
|
||||
return ['', [
|
||||
]];
|
||||
return ['Filtered acp which has no actions'];
|
||||
}
|
||||
|
||||
public function getTitle(): string
|
||||
|
Reference in New Issue
Block a user