You are here

public function AddToWishlistLink::metadata in Commerce Add To Cart Link 2.x

Same name and namespace in other branches
  1. 8 modules/wishlist/src/AddToWishlistLink.php \Drupal\commerce_add_to_wishlist_link\AddToWishlistLink::metadata()

Generate metadata for an add-to-cart link.

Return value

\Drupal\Core\Render\BubbleableMetadata The metadata object.

1 call to AddToWishlistLink::metadata()
AddToWishlistLink::build in modules/wishlist/src/AddToWishlistLink.php
Generate a render array for an add-to-wishlist link.

File

modules/wishlist/src/AddToWishlistLink.php, line 72

Class

AddToWishlistLink
Defines a helper class for constructing add to wishlist links.

Namespace

Drupal\commerce_add_to_wishlist_link

Code

public function metadata() {
  return BubbleableMetadata::createFromRenderArray([
    '#cache' => [
      'contexts' => [
        'user.roles',
      ],
      'tags' => [
        'config:commerce_add_to_cart_link.settings',
      ],
    ],
  ]);
}