MetaModels\DcGeneral\Data\Driver::extractSorting PHP Method

extractSorting() protected method

Extract the sorting from the given config.
protected extractSorting ( ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface $config ) : array
$config ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface The configuration to be applied.
return array
    protected function extractSorting($config)
    {
        $sorting = $config->getSorting();
        $sortBy = key($sorting);
        $sortDir = current($sorting) ?: DCGE::MODEL_SORTING_ASC;
        return array($sortBy, $sortDir);
    }