You are here

public function ArrayObject::bubbleObject in Express 8

Merges an object's cacheable metadata into the variables array.

Parameters

\Drupal\Core\Cache\CacheableDependencyInterface|mixed $object: The object whose cacheability metadata to retrieve. If it implements CacheableDependencyInterface, its cacheability metadata will be used, otherwise, the passed in object must be assumed to be uncacheable, so max-age 0 is set.

Return value

$this

File

themes/contrib/bootstrap/src/Utility/ArrayObject.php, line 149
Contains \Drupal\bootstrap\Utility\ArrayObject.

Class

ArrayObject
Custom ArrayObject implementation.

Namespace

Drupal\bootstrap\Utility

Code

public function bubbleObject($object) {
  BubbleableMetadata::createFromRenderArray($this->array)
    ->merge(BubbleableMetadata::createFromObject($object))
    ->applyTo($this->array);
  return $this;
}