/** * Evaluate the contao 2 sorting flag into sorting mode. * * @param ListingConfigInterface|PropertyInterface $config The property to evaluate the flag for. * * @param int $flag The flag to be evaluated. * * @return void */ protected function evalFlagSorting($config, $flag) { if ($flag < 0 || $flag > 12) { return; } if ($flag % 2 == 1) { $config->setSortingMode(ListingConfigInterface::SORT_ASC); } else { $config->setSortingMode(ListingConfigInterface::SORT_DESC); } }