You are here

public function AcsfVariableStorageMock::getGroup in Acquia Cloud Site Factory Connector 8

Same name and namespace in other branches
  1. 8.2 tests/AcsfVariableStorageMock.php \AcsfVariableStorageMock::getGroup()

Retrieves a group of variables.

Parameters

string $group: The group name of the variables.

mixed $default: The default value of the group.

Return value

array An associative array holding the values of the group of variables, keyed by the variable names.

File

tests/AcsfVariableStorageMock.php, line 114

Class

AcsfVariableStorageMock
Mock AcsfVariableStorage class used for testing.

Code

public function getGroup($group, $default = []) {
  $return = [];
  if (isset($this->group[$group])) {
    foreach ($this->group[$group] as $name) {
      $return[$name] = unserialize($this->storage[$name]['value']);
    }
  }
  if (empty($return)) {
    return $default;
  }
  else {
    return $return;
  }
}