src/Contao/Dca/Builder/Legacy/LegacyDcaDataDefinitionBuilder.php
private function parseOderPropertyInPalette(ContainerInterface $container)
    {
        foreach ($container->getPropertiesDefinition()->getProperties() as $property) {
            $extra = $property->getExtra();
            if (!isset($extra['orderField'])
                || !$container->getPropertiesDefinition()->hasProperty($extra['orderField'])
            ) {
                continue;
            }

            $orderProperty = $container->getPropertiesDefinition()->getProperty($extra['orderField']);
            if (false === (bool) $orderProperty->getWidgetType()) {
                continue;
            }

            foreach ($container->getPalettesDefinition()->getPalettes() as $palette) {
                foreach ($palette->getLegends() as $legend) {
                    if ((false === $legend->hasProperty($property->getName()))
                        || (true === $legend->hasProperty($orderProperty->getName()))
                    ) {
                        continue;
                    }

                    $paletteProperty      = $legend->getProperty($property->getName());
                    $paletteOrderProperty = new Property($orderProperty->getName());
                    $legend->addProperty($paletteOrderProperty, $paletteProperty);

                    $paletteOrderProperty->setEditableCondition($paletteProperty->getEditableCondition());
                    $visibleCondition = new PropertyTrueCondition($property->getName(), false);
                    $paletteOrderProperty->setVisibleCondition($visibleCondition);
                }
            }
        }
    }
private function parseOderPropertyInPalette(ContainerInterface $container)
    {
        foreach ($container->getPropertiesDefinition()->getProperties() as $property) {
            $extra = $property->getExtra();
            if (!isset($extra['orderField'])
                || !$container->getPropertiesDefinition()->hasProperty($extra['orderField'])
            ) {
                continue;
            }

            $orderProperty = $container->getPropertiesDefinition()->getProperty($extra['orderField']);
            if (false === (bool) $orderProperty->getWidgetType()) {
                continue;
            }

            foreach ($container->getPalettesDefinition()->getPalettes() as $palette) {
                foreach ($palette->getLegends() as $legend) {
                    if ((false === $legend->hasProperty($property->getName()))
                        || (true === $legend->hasProperty($orderProperty->getName()))
                    ) {
                        continue;
                    }

                    $paletteProperty      = $legend->getProperty($property->getName());
                    $paletteOrderProperty = new Property($orderProperty->getName());
                    $legend->addProperty($paletteOrderProperty, $paletteProperty);

                    $paletteOrderProperty->setEditableCondition($paletteProperty->getEditableCondition());
                    $visibleCondition = new PropertyTrueCondition($property->getName(), false);
                    $paletteOrderProperty->setVisibleCondition($visibleCondition);
                }
            }
        }
    }
private function parseOderPropertyInPalette ( ContainerInterface $ container ) { foreach ( $ container -> getPropertiesDefinition ( ) -> getProperties ( ) as $ property ) { $ extra = $ property -> getExtra ( ) ; if ( ! isset ( $ extra [ 'orderField' ] ) || ! $ container -> getPropertiesDefinition ( ) -> hasProperty ( $ extra [ 'orderField' ] ) ) { continue ; } $ orderProperty = $ container -> getPropertiesDefinition ( ) -> getProperty ( $ extra [ 'orderField' ] ) ; if ( false === ( bool ) $ orderProperty -> getWidgetType ( ) ) { continue ; } foreach ( $ container -> getPalettesDefinition ( ) -> getPalettes ( ) as $ palette ) { foreach ( $ palette -> getLegends ( ) as $ legend ) { if ( ( false === $ legend -> hasProperty ( $ property -> getName ( ) ) ) || ( true === $ legend -> hasProperty ( $ orderProperty -> getName ( ) ) ) ) { continue ; } $ paletteProperty = $ legend -> getProperty ( $ property -> getName ( ) ) ; $ paletteOrderProperty = new Property ( $ orderProperty -> getName ( ) ) ; $ legend -> addProperty ( $ paletteOrderProperty , $ paletteProperty ) ; $ paletteOrderProperty -> setEditableCondition ( $ paletteProperty -> getEditableCondition ( ) ) ; $ visibleCondition = new PropertyTrueCondition ( $ property -> getName ( ) , false ) ; $ paletteOrderProperty -> setVisibleCondition ( $ visibleCondition ) ; } } } }
Parse if the order property is defined in the same palette as the corresponding source property.
If not, then define it.

@param ContainerInterface $container The container.

@return void
Parse if the order property is defined in the same palette as the corresponding source property . If not then define it .