lithium\storage\cache\Adapter::_addScopePrefix()

protected method

Adds scope prefix to keys using separator.

Parameters

  • string $scope

    Scope to use when prefixing.

  • array $keys

    Array of keys either with or without mapping to values.

  • string $separator

    String to use when separating scope from key.

Returns

array

Prefixed keys array.

Source

	protected function _addScopePrefix($scope, array $keys, $separator = ':') {
		$results = [];
		$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;
	}