src/CoreBundle/EventListener/DcGeneral/Table/DcaSortGroup/VisibilityConditionBuildingListener.php
public function handle(BuildDataDefinitionEvent $event)
    {
        if ('tl_metamodel_dca_sortgroup' !== $event->getContainer()->getName()) {
            return;
        }

        foreach ($event->getContainer()->getPalettesDefinition()->getPalettes() as $palette) {
            foreach ($palette->getProperties() as $property) {
                if ($property->getName() != 'rendergrouptype') {
                    continue;
                }

                $this->addCondition(
                    $property,
                    new PropertyConditionChain(
                        array(
                            new InputScreenRenderModeIs('flat', $this->connection),
                            new InputScreenRenderModeIs('parented', $this->connection),
                        ),
                        PropertyConditionChain::OR_CONJUNCTION
                    )
                );
            }
        }
    }
public function handle(BuildDataDefinitionEvent $event)
    {
        if ('tl_metamodel_dca_sortgroup' !== $event->getContainer()->getName()) {
            return;
        }

        foreach ($event->getContainer()->getPalettesDefinition()->getPalettes() as $palette) {
            foreach ($palette->getProperties() as $property) {
                if ($property->getName() != 'rendergrouptype') {
                    continue;
                }

                $this->addCondition(
                    $property,
                    new PropertyConditionChain(
                        array(
                            new InputScreenRenderModeIs('flat', $this->connection),
                            new InputScreenRenderModeIs('parented', $this->connection),
                        ),
                        PropertyConditionChain::OR_CONJUNCTION
                    )
                );
            }
        }
    }
Set the visibility condition for the widget.

Manipulate the data definition for the property "rendergrouptype" in table "tl_metamodel_dca_sortgroup".

@param BuildDataDefinitionEvent $event The event.

@return void