class WishlistEventContainer

Class WishlistEventContainer is injected as empire_wishlists_plugin.event.container. This container is connecting WishlistManager manager to other services

Constants

WISHLIST_ADD_PRODUCT_EVENT

Product add to wishlist Event name

Properties

protected ContainerInterface $container

Methods

__construct(ContainerInterface $container)

No description

getUser()

No description

getProduct(Product $product)

Get product by id

array
getUsersWithProductInWishList(int $productId, Pricelist|null $priceList = null)

Get emails for all user who have specified product in wishlist

sendProductPriceChangedMail(array $params)

Send mail if product price has changed

bool
sendMail(string $friendsMail, Wishlist $wishlist, string $theme)

Send wishlist via email

string
getCurrentCurrency()

Get current currency from session

Details

at line 39
__construct(ContainerInterface $container)

Parameters

ContainerInterface $container

at line 47
User getUser()

Return Value

User

at line 61
Product getProduct(Product $product)

Get product by id

Parameters

Product $product

Return Value

Product

Exceptions

NoResultException
NonUniqueResultException

at line 73
array getUsersWithProductInWishList(int $productId, Pricelist|null $priceList = null)

Get emails for all user who have specified product in wishlist

Parameters

int $productId
Pricelist|null $priceList

Return Value

array

at line 83
sendProductPriceChangedMail(array $params)

Send mail if product price has changed

Parameters

array $params

at line 105
bool sendMail(string $friendsMail, Wishlist $wishlist, string $theme)

Send wishlist via email

Parameters

string $friendsMail
Wishlist $wishlist
string $theme

Return Value

bool

at line 142
string getCurrentCurrency()

Get current currency from session

Return Value

string

at line 151
EventWithResult dispatchShouldAddProductToWishlist()

Dispatch custom event

Return Value

EventWithResult