class Storage

Theme Storage.

A hybrid storage solution that utilizes the cache system for complex and expensive operations performed by a [base] theme.

Instead of using multiple cache identifiers, which increases the number of database calls, this storage only executes a single cache call and stores individual entries in memory as an associative array.

It also tracks when the data has been modified so it can be saved back to cache before the system fully shuts down.

This storage object can be used in foreach loops.


  • class \Drupal\bootstrap\Utility\Storage extends \Drupal\Core\KeyValueStore\MemoryStorage implements \Iterator

Expanded class hierarchy of Storage

Related topics




Contains filters are case sensitive
Name Modifiers Type Description
Storage::$bin protected property The bin (table) data should be stored in (not prefixed with "cache_").
Storage::$changed protected property Flag determining whether or not the cache should be saved to the database.
Storage::$cid protected property The cache identifier.
Storage::$expire protected property Indicates when the cache should expire.
Storage::$initialized protected property Flag determining whether or not object has been initialized yet.
Storage::$tags protected property Tags to associate with the cached data so it can be properly invalidated.
Storage::changed public function Notifies the object that data has changed.
Storage::current public function
Storage::delete public function
Storage::deleteAll public function
Storage::deleteMultiple public function
Storage::getAll public function
Storage::isEmpty public function Determines if the cache is empty.
Storage::key public function
Storage::next public function
Storage::rename public function
Storage::rewind public function
Storage::save public function Saves the data back to the database, if necessary, on shutdown.
Storage::set public function
Storage::setIfNotExists public function
Storage::setMultiple public function
Storage::valid public function
Storage::__construct public function