lithium\storage\cache\Adapter::_addScopePrefix PHP Method

_addScopePrefix() protected method

Adds scope prefix to keys using separator.
protected _addScopePrefix ( string $scope, array $keys, string $separator = ':' ) : array
$scope string Scope to use when prefixing.
$keys array Array of keys either with or without mapping to values.
$separator string String to use when separating scope from key.
return array Prefixed keys array.
    protected function _addScopePrefix($scope, array $keys, $separator = ':')
    {
        $results = array();
        $isMapped = !is_int(key($keys));
        foreach ($keys as $key => $value) {
            if ($isMapped) {
                $results["{$scope}{$separator}{$key}"] = $value;
            } else {
                $results[$key] = "{$scope}{$separator}{$value}";
            }
        }
        return $results;
    }