public function visibleFilterParams(BuildDataDefinitionEvent $event)
{
if ($event->getContainer()->getName() !== 'tl_metamodel_searchable_pages') {
return;
}
foreach ($event->getContainer()->getPalettesDefinition()->getPalettes() as $palette) {
foreach ($palette->getProperties() as $property) {
if ($property->getName() != 'filterparams') {
continue;
}
$chain = $property->getVisibleCondition();
if (!($chain && $chain instanceof PropertyConditionChain && $chain->getConjunction() == PropertyConditionChain::AND_CONJUNCTION)) {
$chain = new PropertyConditionChain($chain ?: array(), PropertyConditionChain::AND_CONJUNCTION);
$property->setVisibleCondition($chain);
}
$chain->addCondition(new NotCondition(new PropertyValueCondition('filter', 0)));
break;
}
}
}