class WishlistEntityAddEvent in Commerce Wishlist 8.3
Defines the wishlist entity add event.
Hierarchy
- class \Drupal\commerce_wishlist\Event\WishlistEntityAddEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of WishlistEntityAddEvent
See also
\Drupal\commerce_wishlist\Event\WishlistEvents
2 files declare their use of WishlistEntityAddEvent
- WishlistEventSubscriber.php in src/
EventSubscriber/ WishlistEventSubscriber.php - WishlistManager.php in src/
WishlistManager.php
File
- src/
Event/ WishlistEntityAddEvent.php, line 15
Namespace
Drupal\commerce_wishlist\EventView source
class WishlistEntityAddEvent extends Event {
/**
* The wishlist entity.
*
* @var \Drupal\commerce_wishlist\Entity\WishlistInterface
*/
protected $wishlist;
/**
* The added entity.
*
* @var \Drupal\commerce\PurchasableEntityInterface
*/
protected $entity;
/**
* The quantity.
*
* @var float
*/
protected $quantity;
/**
* The destination wishlist item.
*
* @var \Drupal\commerce_wishlist\Entity\WishlistItemInterface
*/
protected $wishlistItem;
/**
* Constructs a new WishlistWishlistItemEvent.
*
* @param \Drupal\commerce_wishlist\Entity\WishlistInterface $wishlist
* The wishlist entity.
* @param \Drupal\commerce\PurchasableEntityInterface $entity
* The added entity.
* @param float $quantity
* The quantity.
* @param \Drupal\commerce_wishlist\Entity\WishlistItemInterface $wishlist_item
* The destination wishlist item.
*/
public function __construct(WishlistInterface $wishlist, PurchasableEntityInterface $entity, $quantity, WishlistItemInterface $wishlist_item) {
$this->wishlist = $wishlist;
$this->entity = $entity;
$this->quantity = $quantity;
$this->wishlistItem = $wishlist_item;
}
/**
* Gets the wishlist entity.
*
* @return \Drupal\commerce_wishlist\Entity\WishlistInterface
* The wishlist entity.
*/
public function getWishlist() {
return $this->wishlist;
}
/**
* Gets the added entity.
*
* @return \Drupal\commerce\PurchasableEntityInterface
* The added entity.
*/
public function getEntity() {
return $this->entity;
}
/**
* Gets the quantity.
*
* @return float
* The quantity.
*/
public function getQuantity() {
return $this->quantity;
}
/**
* Gets the destination wishlist item.
*
* @return \Drupal\commerce_wishlist\Entity\WishlistItemInterface
* The destination wishlist item.
*/
public function getWishlistItem() {
return $this->wishlistItem;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
WishlistEntityAddEvent:: |
protected | property | The added entity. | |
WishlistEntityAddEvent:: |
protected | property | The quantity. | |
WishlistEntityAddEvent:: |
protected | property | The wishlist entity. | |
WishlistEntityAddEvent:: |
protected | property | The destination wishlist item. | |
WishlistEntityAddEvent:: |
public | function | Gets the added entity. | |
WishlistEntityAddEvent:: |
public | function | Gets the quantity. | |
WishlistEntityAddEvent:: |
public | function | Gets the wishlist entity. | |
WishlistEntityAddEvent:: |
public | function | Gets the destination wishlist item. | |
WishlistEntityAddEvent:: |
public | function | Constructs a new WishlistWishlistItemEvent. |