You are here

public function AcquiaPurgeStateStorageBase::get in Acquia Purge 7

Retrieve the object named $key.

Parameters

int $key: The key with which the object is stored in state storage.

mixed|null $default: (optional) The default value to use if the entry doesn't yet exist.

Return value

AcquiaPurgeStateItemInterface The item.

Overrides AcquiaPurgeStateStorageInterface::get

File

lib/state/AcquiaPurgeStateStorageBase.php, line 75
Contains AcquiaPurgeStateStorageBase.

Class

AcquiaPurgeStateStorageBase
Base layer for state storage backends.

Code

public function get($key, $default = NULL) {
  if (!isset($this->items[$key])) {
    _acquia_purge_load('_acquia_purge_state_item_interface');
    $class = _acquia_purge_load('_acquia_purge_state_item');
    $this->items[$key] = new $class($this, $key, $default);
  }
  return $this->items[$key];
}