Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Render/BubbleableMetadata.php \Drupal\Core\Render\BubbleableMetadata::addCacheableDependency()
  2. 9 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;
}