"Fossies" - the Fresh Open Source Software Archive

Member "drupal-8.9.9/core/lib/Drupal/Core/Render/AttachmentsTrait.php" (18 Nov 2020, 744 Bytes) of package /linux/www/drupal-8.9.9.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "AttachmentsTrait.php" see the Fossies "Dox" file reference documentation.

    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 }