MetaModels\DcGeneral\Events\Table\InputScreenSortGroup\Subscriber::setVisibility PHP Method

setVisibility() public method

Manipulate the data definition for the property "rendergrouptype" in table "tl_metamodel_dca_sortgroup".
public setVisibility ( ContaoCommunityAlliance\DcGeneral\Factory\Event\BuildDataDefinitionEvent $event ) : void
$event ContaoCommunityAlliance\DcGeneral\Factory\Event\BuildDataDefinitionEvent The event.
return void
    public function setVisibility(BuildDataDefinitionEvent $event)
    {
        foreach ($event->getContainer()->getPalettesDefinition()->getPalettes() as $palette) {
            foreach ($palette->getProperties() as $property) {
                if ($property->getName() != 'rendergrouptype') {
                    continue;
                }
                self::addCondition($property, new PropertyConditionChain(array(new InputScreenRenderModeIs('flat'), new InputScreenRenderModeIs('parented')), PropertyConditionChain::OR_CONJUNCTION));
            }
        }
    }