You are here

public function ContributeManager::getPerson in Contribute 8

File

src/ContributeManager.php, line 442

Class

ContributeManager
Class ContributeManager.

Namespace

Drupal\contribute

Code

public function getPerson($type) {
  if (isset($this->cachedPeople[$type])) {
    return $this->cachedPeople[$type];
  }
  $people = $this
    ->getPeople($type);
  $person = $people[array_rand($people)];
  $this->cachedPeople[$type] = $person;
  return $person;
}