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
                    )
                );
            }
        }
    }