Upgraded drupal core with security updates
[yaffs-website] / web / core / lib / Drupal / Core / Render / AttachmentsTrait.php
1 <?php
2
3 namespace Drupal\Core\Render;
4
5 /**
6  * Provides an implementation of AttachmentsInterface.
7  *
8  * @see \Drupal\Core\Render\AttachmentsInterface
9  */
10 trait AttachmentsTrait {
11
12   /**
13    * The attachments for this response.
14    *
15    * @var array
16    */
17   protected $attachments = [];
18
19   /**
20    * {@inheritdoc}
21    */
22   public function getAttachments() {
23     return $this->attachments;
24   }
25
26   /**
27    * {@inheritdoc}
28    */
29   public function addAttachments(array $attachments) {
30     $this->attachments = BubbleableMetadata::mergeAttachments($this->attachments, $attachments);
31     return $this;
32   }
33
34   /**
35    * {@inheritdoc}
36    */
37   public function setAttachments(array $attachments) {
38     $this->attachments = $attachments;
39     return $this;
40   }
41
42 }