You are here

public function Redis_Path_AbstractHashLookup::saveAlias in Redis 7.3

Alias is being inserted with the given source

Parameters

string $source:

string $alias:

string $language:

Overrides Redis_Path_HashLookupInterface::saveAlias

File

lib/Redis/Path/AbstractHashLookup.php, line 53

Class

Redis_Path_AbstractHashLookup
Common implementation for Redis-based implementations

Code

public function saveAlias($source, $alias, $language = null) {
  $alias = $this
    ->normalize($alias);
  $source = $this
    ->normalize($source);
  if (null === $language) {
    $language = LANGUAGE_NONE;
  }
  if (!empty($source)) {
    $this
      ->saveInHash($this
      ->getKey(array(
      self::KEY_ALIAS,
      $language,
    )), $source, $alias);
  }
  if (!empty($alias)) {
    $this
      ->saveInHash($this
      ->getKey(array(
      self::KEY_SOURCE,
      $language,
    )), $alias, $source);
  }
}