src/Contao/View/Contao2BackendView/Subscriber/GetGroupHeaderSubscriber.php
private function formatByGroupingMode(
        $groupingMode,
        $groupingLength,
        EnvironmentInterface $environment,
        PropertyInterface $property,
        ModelInterface $model
    ) {
        switch ($groupingMode) {
            case GroupAndSortingInformationInterface::GROUP_CHAR:
                return $this->formatByCharGrouping(
                    ViewHelpers::getReadableFieldValue($environment, $property, $model),
                    $groupingLength
                );

            case GroupAndSortingInformationInterface::GROUP_DAY:
                return $this->formatByDayGrouping((int) $model->getProperty($property->getName()));

            case GroupAndSortingInformationInterface::GROUP_MONTH:
                return $this->formatByMonthGrouping((int) $model->getProperty($property->getName()));

            case GroupAndSortingInformationInterface::GROUP_YEAR:
                return $this->formatByYearGrouping((int) $model->getProperty($property->getName()));

            default:
                return ViewHelpers::getReadableFieldValue($environment, $property, $model);
        }
    }
private function formatByGroupingMode(
        $groupingMode,
        $groupingLength,
        EnvironmentInterface $environment,
        PropertyInterface $property,
        ModelInterface $model
    ) {
        switch ($groupingMode) {
            case GroupAndSortingInformationInterface::GROUP_CHAR:
                return $this->formatByCharGrouping(
                    ViewHelpers::getReadableFieldValue($environment, $property, $model),
                    $groupingLength
                );

            case GroupAndSortingInformationInterface::GROUP_DAY:
                return $this->formatByDayGrouping((int) $model->getProperty($property->getName()));

            case GroupAndSortingInformationInterface::GROUP_MONTH:
                return $this->formatByMonthGrouping((int) $model->getProperty($property->getName()));

            case GroupAndSortingInformationInterface::GROUP_YEAR:
                return $this->formatByYearGrouping((int) $model->getProperty($property->getName()));

            default:
                return ViewHelpers::getReadableFieldValue($environment, $property, $model);
        }
    }
private function formatByGroupingMode ( $ groupingMode , $ groupingLength , EnvironmentInterface $ environment , PropertyInterface $ property , ModelInterface $ model ) { switch ( $ groupingMode ) { case GroupAndSortingInformationInterface :: GROUP_CHAR : return $ this -> formatByCharGrouping ( ViewHelpers :: getReadableFieldValue ( $ environment , $ property , $ model ) , $ groupingLength ) ; case GroupAndSortingInformationInterface :: GROUP_DAY : return $ this -> formatByDayGrouping ( ( int ) $ model -> getProperty ( $ property -> getName ( ) ) ) ; case GroupAndSortingInformationInterface :: GROUP_MONTH : return $ this -> formatByMonthGrouping ( ( int ) $ model -> getProperty ( $ property -> getName ( ) ) ) ; case GroupAndSortingInformationInterface :: GROUP_YEAR : return $ this -> formatByYearGrouping ( ( int ) $ model -> getProperty ( $ property -> getName ( ) ) ) ; default : return ViewHelpers :: getReadableFieldValue ( $ environment , $ property , $ model ) ; } }
Format the group header by the grouping mode.

@param int                  $groupingMode   The grouping mode.
@param int                  $groupingLength The grouping length.
@param EnvironmentInterface $environment    The environment.
@param PropertyInterface    $property       The current property definition.
@param ModelInterface       $model          The current data model.

@return string
Format the group header by the grouping mode .