You are here

interface WishlistSessionInterface in Commerce Wishlist 8.3

Stores wishlist ids in the anonymous user's session.

Allows the system to keep track of which wishlist entities belong to the anonymous user. The session is the only available storage in this case, since all anonymous users share the same user id (0).

Hierarchy

Expanded class hierarchy of WishlistSessionInterface

All classes that implement WishlistSessionInterface

See also

\Drupal\commerce_wishlist\WishlistProviderInterface

2 files declare their use of WishlistSessionInterface
WishlistItemDetailsAccessCheck.php in src/Access/WishlistItemDetailsAccessCheck.php
WishlistUserForm.php in src/Form/WishlistUserForm.php

File

src/WishlistSessionInterface.php, line 14

Namespace

Drupal\commerce_wishlist
View source
interface WishlistSessionInterface {

  /**
   * Gets all wishlist ids from the session.
   *
   * @return int[]
   *   A list of wishlist ids.
   */
  public function getWishlistIds();

  /**
   * Adds the given wishlist ID to the session.
   *
   * @param int $wishlist_id
   *   The wishlist ID.
   */
  public function addWishlistId($wishlist_id);

  /**
   * Checks whether the given wishlist ID exists in the session.
   *
   * @param int $wishlist_id
   *   The wishlist ID.
   *
   * @return bool
   *   TRUE if the given wishlist ID exists in the session, FALSE otherwise.
   */
  public function hasWishlistId($wishlist_id);

  /**
   * Deletes the given wishlist ID from the session.
   *
   * @param int $wishlist_id
   *   The wishlist ID.
   */
  public function deleteWishlistId($wishlist_id);

}

Members

Namesort descending Modifiers Type Description Overrides
WishlistSessionInterface::addWishlistId public function Adds the given wishlist ID to the session. 1
WishlistSessionInterface::deleteWishlistId public function Deletes the given wishlist ID from the session. 1
WishlistSessionInterface::getWishlistIds public function Gets all wishlist ids from the session. 1
WishlistSessionInterface::hasWishlistId public function Checks whether the given wishlist ID exists in the session. 1