src/Contao/View/Contao2BackendView/ActionHandler/MultipleHandler/SelectPropertyAllHandler.php
private function setPropertyLabelFormatter($providerName, EnvironmentInterface $environment)
    {
        $properties = $environment->getDataDefinition()->getPropertiesDefinition();

        $labelFormatter = (new DefaultModelFormatterConfig())
            ->setPropertyNames(['name', 'description'])
            ->setFormat('%s <span style="color:#b3b3b3; padding-left:3px">[%s]</span>');

        $this->getViewSection($environment->getDataDefinition())
            ->getListingConfig()
            ->setLabelFormatter($providerName, $labelFormatter);

        // If property name not exits create dummy property for it.
        foreach (['name', 'description'] as $dummyName) {
            if (!$properties->hasProperty($dummyName)) {
                $dummyProperty = new DefaultProperty($dummyName);
                $dummyProperty->setWidgetType('dummyProperty');

                $properties->addProperty($dummyProperty);
            }
        }
    }
private function setPropertyLabelFormatter($providerName, EnvironmentInterface $environment)
    {
        $properties = $environment->getDataDefinition()->getPropertiesDefinition();

        $labelFormatter = (new DefaultModelFormatterConfig())
            ->setPropertyNames(['name', 'description'])
            ->setFormat('%s <span style="color:#b3b3b3; padding-left:3px">[%s]</span>');

        $this->getViewSection($environment->getDataDefinition())
            ->getListingConfig()
            ->setLabelFormatter($providerName, $labelFormatter);

        // If property name not exits create dummy property for it.
        foreach (['name', 'description'] as $dummyName) {
            if (!$properties->hasProperty($dummyName)) {
                $dummyProperty = new DefaultProperty($dummyName);
                $dummyProperty->setWidgetType('dummyProperty');

                $properties->addProperty($dummyProperty);
            }
        }
    }
private function setPropertyLabelFormatter ( $ providerName , EnvironmentInterface $ environment ) { $ properties = $ environment -> getDataDefinition ( ) -> getPropertiesDefinition ( ) ; $ labelFormatter = ( new DefaultModelFormatterConfig ( ) ) -> setPropertyNames ( [ 'name' , 'description' ] ) -> setFormat ( '%s <span style="color:#b3b3b3; padding-left:3px">[%s]</span>' ) ; $ this -> getViewSection ( $ environment -> getDataDefinition ( ) ) -> getListingConfig ( ) -> setLabelFormatter ( $ providerName , $ labelFormatter ) ; // If property name not exits create dummy property for it. foreach ( [ 'name' , 'description' ] as $ dummyName ) { if ( ! $ properties -> hasProperty ( $ dummyName ) ) { $ dummyProperty = new DefaultProperty ( $ dummyName ) ; $ dummyProperty -> setWidgetType ( 'dummyProperty' ) ; $ properties -> addProperty ( $ dummyProperty ) ; } } }
Set the label formatter for property data provider to the listing configuration.

@param string               $providerName The provider name.
@param EnvironmentInterface $environment  The environment.

@return void
Set the label formatter for property data provider to the listing configuration .