You are here

public function BubbleableMetadata::addCacheableDependency in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Render/BubbleableMetadata.php \Drupal\Core\Render\BubbleableMetadata::addCacheableDependency()
  2. 10 core/lib/Drupal/Core/Render/BubbleableMetadata.php \Drupal\Core\Render\BubbleableMetadata::addCacheableDependency()

Overrides RefinableCacheableDependencyTrait::addCacheableDependency

File

core/lib/Drupal/Core/Render/BubbleableMetadata.php, line 95

Class

BubbleableMetadata
Value object used for bubbleable rendering metadata.

Namespace

Drupal\Core\Render

Code

public function addCacheableDependency($other_object) {
  parent::addCacheableDependency($other_object);
  if ($other_object instanceof AttachmentsInterface) {
    $this
      ->addAttachments($other_object
      ->getAttachments());
  }
  return $this;
}