src/Contao/Dca/Builder/Legacy/LegacyDcaDataDefinitionBuilder.php
protected function parsePropertySortingAndGrouping($propName, $propInfo, $definitions, $parsedProperties)
    {
        if (empty($propInfo['sorting']) || \in_array($propName, $parsedProperties)) {
            return;
        }

        $definition  = $definitions->add()->setName($propName);
        $information = $definition->add();
        $information->setProperty($propName);
        if (isset($propInfo['length'])) {
            $information->setGroupingLength($propInfo['length']);
        }

        // Special case for field named "sorting" in Contao.
        if ('sorting' === $propName) {
            $information->setManualSorting();
        }

        // If no default sorting and grouping definition is defined, assume the first one is default.
        if (!$definitions->hasDefault()) {
            $definitions->markDefault($definition);
        }

        $flag = empty($propInfo['flag']) ? $this->getFromDca('list/sorting/flag') : $propInfo['flag'];
        $this->evalFlag($information, $flag);
    }
protected function parsePropertySortingAndGrouping($propName, $propInfo, $definitions, $parsedProperties)
    {
        if (empty($propInfo['sorting']) || \in_array($propName, $parsedProperties)) {
            return;
        }

        $definition  = $definitions->add()->setName($propName);
        $information = $definition->add();
        $information->setProperty($propName);
        if (isset($propInfo['length'])) {
            $information->setGroupingLength($propInfo['length']);
        }

        // Special case for field named "sorting" in Contao.
        if ('sorting' === $propName) {
            $information->setManualSorting();
        }

        // If no default sorting and grouping definition is defined, assume the first one is default.
        if (!$definitions->hasDefault()) {
            $definitions->markDefault($definition);
        }

        $flag = empty($propInfo['flag']) ? $this->getFromDca('list/sorting/flag') : $propInfo['flag'];
        $this->evalFlag($information, $flag);
    }
protected function parsePropertySortingAndGrouping ( $ propName , $ propInfo , $ definitions , $ parsedProperties ) { if ( empty ( $ propInfo [ 'sorting' ] ) || \ in_array ( $ propName , $ parsedProperties ) ) { return ; } $ definition = $ definitions -> add ( ) -> setName ( $ propName ) ; $ information = $ definition -> add ( ) ; $ information -> setProperty ( $ propName ) ; if ( isset ( $ propInfo [ 'length' ] ) ) { $ information -> setGroupingLength ( $ propInfo [ 'length' ] ) ; } // Special case for field named "sorting" in Contao. if ( 'sorting' === $ propName ) { $ information -> setManualSorting ( ) ; } // If no default sorting and grouping definition is defined, assume the first one is default. if ( ! $ definitions -> hasDefault ( ) ) { $ definitions -> markDefault ( $ definition ) ; } $ flag = empty ( $ propInfo [ 'flag' ] ) ? $ this -> getFromDca ( 'list/sorting/flag' ) : $ propInfo [ 'flag' ] ; $ this -> evalFlag ( $ information , $ flag ) ; }
Parse the sorting and grouping information for a given property.

@param string                                       $propName         The property to parse.
@param array                                        $propInfo         The property information.
@param GroupAndSortingDefinitionCollectionInterface $definitions      The definitions.
@param array                                        $parsedProperties A list of properties already parsed.

@return void
Parse the sorting and grouping information for a given property .