You are here

protected function SeedCalculator::getSeed in Views random seed 8

Get the seed either from session or store.

Parameters

$seed_name:

Return value

mixed

1 call to SeedCalculator::getSeed()
SeedCalculator::calculateSeed in src/SeedCalculator.php
Calculate a seed.

File

src/SeedCalculator.php, line 171

Class

SeedCalculator
Calculates seeds.

Namespace

Drupal\views_random_seed

Code

protected function getSeed($seed_name) {
  $user_seed_type = $this->options['user_seed_type'];
  if ($user_seed_type === 'diff_per_user' && ($this->currentUser
    ->isAuthenticated() || $this->options['anonymous_session'])) {
    $this
      ->debug('getSeed: diff per user');
    return $this
      ->getSeedFromSession($seed_name);
  }
  else {
    $this
      ->debug('getSeed: same per user');
    return $this->keyValueStore
      ->get($seed_name, FALSE);
  }
}