The config sorting prefixer.

@param ConfigInterface $config The config.

@return void
196959
private function sortingPrefixer(ConfigInterface $config)
    {
        $sorting = [];
        foreach ($config->getSorting() as $property => $value) {
            if (0 === \strpos($property, $this->source . '.')) {
                $sorting[$property] = $value;

                continue;
            }

            if (!$this->fieldExists($property)) {
                continue;
            }

            $sorting[$this->source . '.' . $property] = $value;
        }
        $config->setSorting($sorting);
    }
1071794
public static function setConfig(Config $config): void
    {
        if ($config->name() == 'application') {
            throw new ConfigException('Can\'t set config under \'application\' name; name \'application\' is not permitted because it shouldn\'t be possible to change those settings in runtime');
        }

        static::$configs[$config->name()] = $config;
    }
281726
protected function applySort(SortConfig $sortConfig)
    {
        $attributePath = $sortConfig->getColumn();
        if (!$attributePath) {
            return;
        }

        $rootAttribute = explode('.', $attributePath)[0];
        if (!$rootAttribute || !$this->getFamily()->hasAttribute($rootAttribute)) {
            parent::applySort($sortConfig);

            return;
        }

        $qb = $this->getQueryBuilder();
        $eavQb = new EAVQueryBuilder($qb, $this->getAlias());
        $eavQb->setContext($this->getQueryContext());
        $attributeQb = $this->getEAVAttributeQueryBuilder($eavQb, $attributePath);
        $qb->addOrderBy($attributeQb->applyJoin()->getColumn(), $sortConfig->getDirection() ? 'DESC' : 'ASC');
    }
577135
protected function setParsedConfig(array $config)
    {
        foreach ($config as $key => $value) {
            $setter = 'set'.ucfirst($key);
            $this->$setter($value);
        }
    }
745990
protected function _initialize(KObjectConfig $config)
    {
        $config->append(array(
            'priority' => self::PRIORITY_LOW,
        ));

        parent::_initialize($config);
    }
712443
public static function setConfiguration($config)
	{
		if(!is_array($config))
			throw new ConfigurationException('Configuration needs to be an array');
		
		if(array_key_exists('primaryGSLSNode')) self::$primaryGSLSNode = $config['primaryGSLSNode'];
		if(array_key_exists('secondaryGSLSNode')) self::$secondaryGSLSNode = $config['secondaryGSLSNode'];
		
		if(array_key_exists('apiPath')) self::$apiPath = $config['apiPath'];
		if(array_key_exists('timezone')) self::$timezone = $config['timezone'];
		if(array_key_exists('verbose')) self::$verbose = $config['verbose'];
		if(array_key_exists('curlVerbose')) self::$curlVerbose = $config['curlVerbose'];
		if(array_key_exists('requestTimeout')) self::$requestTimeout = $config['requestTimeout'];
		if(array_key_exists('gslsTimeout')) self::$gslsTimeout = $config['gslsTimeout'];
		if(array_key_exists('logfile')) self::$logfile = $config['logfile'];
	}
1247521
public function registerFindables(ConfigInterface $config)
    {
        $findables = (array) $config->getKey($this->getFindablesConfigKey());
        foreach ($findables as $findableKey => $findableObject) {
            $this->findables->set($findableKey, $findableObject);
        }
    }
765364
public function initServices(Config $config)
    {
        $serviceProviderLoader = new ServiceProviderLoader($this->getDI());
        $serviceProviderLoader->autoload(
            $config->application->serviceDir,
            $config->application->configDir
        );
    }
104985
protected function _initialize(KObjectConfig $config)
    {
        $config->append(array(
            'priority' => KTemplateFilterInterface::PRIORITY_HIGH
        ));

        parent::_initialize($config);
    }
951129
public function processConfiguration($config)
    {
        $factory = new ConfigurationProcessorFactory();
        $processor = $factory->create(gettype($config));
        $config = $processor->convertToObjectConfiguration($config);
        $processor->validate($config);
        $this->config = $config;
    }
740970
public static function buildSortingQuery($config)
    {
        $sorting = $config->getSorting();
        $result  = '';
        $fields  = [];

        if (empty($sorting) || !\is_array($sorting)) {
            return '';
        }
        foreach ($sorting as $field => $direction) {
            // array could be a simple field list or list of field => direction combinations.
            if (!empty($direction)) {
                $direction = \strtoupper($direction);
                if (!\in_array($direction, [DCGE::MODEL_SORTING_ASC, DCGE::MODEL_SORTING_DESC])) {
                    $field     = $direction;
                    $direction = DCGE::MODEL_SORTING_ASC;
                }
            } else {
                $direction = DCGE::MODEL_SORTING_ASC;
            }

            $fields[] = $field . ' ' . $direction;
        }

        $result .= ' ORDER BY ' . \implode(', ', $fields);

        return $result;
    }
937724
public function replace(array $config) : ConfigInterface
    {
        foreach ($config as $key => $configuration) {
            $this->set($key, $configuration);
        }

        return $this;
    }
127467
protected function _initialize(KObjectConfig $config)
    {
        $config->append(array(
            'priority' => self::PRIORITY_LOW,
            'title'    => '',
            'class'    => '',
            'styles'   => array(),
            'attribs'  => array(
                'name'  => $this->getIdentifier()->package . '_' . $this->getIdentifier()->name,
                'first' => null,
                'last'  => null,
            )
        ));

        parent::_initialize($config);
    }
816044
protected function getOptionsFromConfig(Config $config)
    {
        $options = $this->options;
        foreach (static::$mappingOptions as $option => $ossOption) {
            if (! $config->has($option)) {
                continue;
            }
            $options[$ossOption] = $config->get($option);
        }

        return $options;
    }
22220
public function getUiHandler(ConfigInterface $config)
    {
        if ($config->isHidden()) {
            return null;
        }

        foreach ($this->uiHandlers as $ui) {
            if ($ui->isCompatible($config)) {
                return $ui;
            }
        }

        return null;
    }
1159664
public function sort($config = array())
    {
        $config = new KObjectConfigJson($config);
        $config->append(array(
            'title'     => '',
            'column'    => '',
            'direction' => 'asc',
            'sort'      => ''
        ));

        $translator = $this->getObject('translator');

        //Set the title
        if(empty($config->title)) {
            $config->title = ucfirst($config->column);
        }

        //Set the direction
        $direction	= strtolower($config->direction);
        $direction 	= in_array($direction, array('asc', 'desc')) ? $direction : 'asc';

        $url = clone $this->getTemplate()->url();

        $query              = $url->getQuery(1);
        $query['sort']      = $config->column;
        $query['direction'] = ($direction == 'desc' ? 'asc' : 'desc'); // toggle
        $url->setQuery($query);

        $html  = '<a href="'.$url.'" data-k-tooltip=\'{"container":".k-ui-container","delay":{"show":500,"hide":50}}\' data-original-title="'.$translator->translate('Click to sort by this column').'">';
        $html .= $translator->translate($config->title);

        if($config->column == $config->sort)
        {
            $direction = $direction == 'desc' ? 'descending' : 'ascending'; // toggle
            $html .= '<span class="k-sort-'.$direction.'" aria-hidden="true"></span>';
            $html .= '<span class="k-visually-hidden">'.$direction.'</span>';
        }

        $html .= '</a>';


        return $html;
    }
800842
protected function loadConfig(array $config)
	{
		$this->className = $config['class'];
		$this->itemPerPage = (int) $config['item_per_page'];
		$this->maxPageNumber = (int) $config['max_page_number'];		
	}