You are here

public function WishlistSession::hasWishlistId in Commerce Wishlist 8.3

Checks whether the given wishlist ID exists in the session.

Parameters

int $wishlist_id: The wishlist ID.

Return value

bool TRUE if the given wishlist ID exists in the session, FALSE otherwise.

Overrides WishlistSessionInterface::hasWishlistId

File

src/WishlistSession.php, line 48

Class

WishlistSession
Default implementation of the wishlist session.

Namespace

Drupal\commerce_wishlist

Code

public function hasWishlistId($wishlist_id) {
  $ids = $this->session
    ->get('commerce_wishlists', []);
  return in_array($wishlist_id, $ids);
}