You are here

class WishlistEmptyEvent in Commerce Wishlist 8.3

Defines the wishlist empty event.

Hierarchy

  • class \Drupal\commerce_wishlist\Event\WishlistEmptyEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of WishlistEmptyEvent

See also

\Drupal\commerce_wishlist\Event\WishlistEvents

1 file declares its use of WishlistEmptyEvent
WishlistManager.php in src/WishlistManager.php

File

src/Event/WishlistEmptyEvent.php, line 13

Namespace

Drupal\commerce_wishlist\Event
View source
class WishlistEmptyEvent extends Event {

  /**
   * The wishlist entity.
   *
   * @var \Drupal\commerce_wishlist\Entity\WishlistInterface
   */
  protected $wishlist;

  /**
   * The removed wishlist items.
   *
   * @var \Drupal\commerce_wishlist\Entity\WishlistItemInterface[]
   */
  protected $wishlistItems;

  /**
   * Constructs a new WishlistEmptyEvent.
   *
   * @param \Drupal\commerce_wishlist\Entity\WishlistInterface $wishlist
   *   The wishlist entity.
   * @param \Drupal\commerce_wishlist\Entity\WishlistItemInterface[] $wishlist_items
   *   The removed wishlist items.
   */
  public function __construct(WishlistInterface $wishlist, array $wishlist_items) {
    $this->wishlist = $wishlist;
    $this->wishlistItems = $wishlist_items;
  }

  /**
   * Gets the wishlist entity.
   *
   * @return \Drupal\commerce_wishlist\Entity\WishlistInterface
   *   The wishlist entity.
   */
  public function getWishlist() {
    return $this->wishlist;
  }

  /**
   * Gets the removed wishlist items.
   *
   * @return \Drupal\commerce_wishlist\Entity\WishlistItemInterface[]
   *   The removed wishlist items.
   */
  public function getItems() {
    return $this->wishlistItems;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
WishlistEmptyEvent::$wishlist protected property The wishlist entity.
WishlistEmptyEvent::$wishlistItems protected property The removed wishlist items.
WishlistEmptyEvent::getItems public function Gets the removed wishlist items.
WishlistEmptyEvent::getWishlist public function Gets the wishlist entity.
WishlistEmptyEvent::__construct public function Constructs a new WishlistEmptyEvent.