ControllerBase::keyValue

protected ControllerBase::keyValue($collection)

Returns a key/value storage collection.

Parameters

string $collection: Name of the key/value collection to return.

Return value

\Drupal\Core\KeyValueStore\KeyValueStoreInterface

File

core/lib/Drupal/Core/Controller/ControllerBase.php, line 207

Class

ControllerBase
Utility base class for thin controllers.

Namespace

Drupal\Core\Controller

Code

protected function keyValue($collection) {
  if (!$this->keyValue) {
    $this->keyValue = $this->container()->get('keyvalue')->get($collection);
  }
  return $this->keyValue;
}
doc_Drupal
2016-10-29 08:58:57
Comments
Leave a Comment

Please login to continue.