You are here

public function WishlistItemViewsData::getViewsData in Commerce Wishlist 8.3

Returns views data for the entity type.

Return value

array Views data in the format of hook_views_data().

Overrides CommerceEntityViewsData::getViewsData

File

src/WishlistItemViewsData.php, line 15

Class

WishlistItemViewsData
Provides views data for wishlist items.

Namespace

Drupal\commerce_wishlist

Code

public function getViewsData() {
  $data = parent::getViewsData();
  $data['commerce_wishlist_item']['edit_quantity']['field'] = [
    'title' => t('Wishlist quantity text field'),
    'help' => t('Adds a text field for editing the quantity.'),
    'id' => 'commerce_wishlist_item_edit_quantity',
  ];
  $data['commerce_wishlist_item']['remove_button']['field'] = [
    'title' => t('Remove button'),
    'help' => t('Adds a button for removing the wishlist item.'),
    'id' => 'commerce_wishlist_item_remove_button',
  ];
  $data['commerce_wishlist_item']['move_to_cart']['field'] = [
    'title' => t('Move/copy to cart button'),
    'help' => t('Adds a button for moving or copying the wishlist item to the shopping cart.'),
    'id' => 'commerce_wishlist_item_move_to_cart',
  ];
  return $data;
}