class Cart extends BaseAction implements EventSubscriberInterface

Class Cart where all actions are manage like adding, modifying or delete items.

Class Cart

Methods

mixed
genericToggleVisibility( ModelCriteria $query, ToggleVisibilityEvent $event, EventDispatcherInterface $dispatcher = null)

Toggle visibility for an object

from  BaseAction
__construct( RequestStack $requestStack, TokenProvider $tokenProvider)

No description

persistCart( CartPersistEvent $event)

No description

addItem( CartEvent $event, $eventName, EventDispatcherInterface $dispatcher)

add an article in the current cart

deleteItem( CartEvent $event)

Delete specify article present into cart

clear( CartEvent $event)

Clear the cart

changeItem( CartEvent $event, $eventName, EventDispatcherInterface $dispatcher)

Modify article's quantity

updateCart( CurrencyChangeEvent $event, $eventName, EventDispatcherInterface $dispatcher)

No description

updateCartPrices( Cart $cart, Currency $currency)

Refresh article's price

findCartItem( CartEvent $event)

Find a specific record in CartItem table using the current CartEvent

restoreCurrentCart( CartRestoreEvent $cartRestoreEvent, $eventName, EventDispatcherInterface $dispatcher)

Search if cart already exists in session. If not try to restore it from the cart cookie, or duplicate an old one.

createEmptyCart( CartCreateEvent $cartCreateEvent)

Create a new, empty cart object, and assign it to the current customer, if any.

static 
getSubscribedEvents()

{@inheritdoc}

Details

in BaseAction at line 130
mixed genericToggleVisibility( ModelCriteria $query, ToggleVisibilityEvent $event, EventDispatcherInterface $dispatcher = null)

Toggle visibility for an object

Parameters

ModelCriteria $query
ToggleVisibilityEvent $event
EventDispatcherInterface $dispatcher

Return Value

mixed

at line 54
__construct( RequestStack $requestStack, TokenProvider $tokenProvider)

Parameters

RequestStack $requestStack
TokenProvider $tokenProvider

at line 61
persistCart( CartPersistEvent $event)

Parameters

CartPersistEvent $event

at line 80
addItem( CartEvent $event, $eventName, EventDispatcherInterface $dispatcher)

add an article in the current cart

Parameters

CartEvent $event
$eventName
EventDispatcherInterface $dispatcher

at line 128
deleteItem( CartEvent $event)

Delete specify article present into cart

Parameters

CartEvent $event

at line 143
clear( CartEvent $event)

Clear the cart

Parameters

CartEvent $event

at line 160
changeItem( CartEvent $event, $eventName, EventDispatcherInterface $dispatcher)

Modify article's quantity

don't use Form here just test the Request.

Parameters

CartEvent $event
$eventName
EventDispatcherInterface $dispatcher

at line 178
updateCart( CurrencyChangeEvent $event, $eventName, EventDispatcherInterface $dispatcher)

Parameters

CurrencyChangeEvent $event
$eventName
EventDispatcherInterface $dispatcher

at line 194
updateCartPrices( Cart $cart, Currency $currency)

Refresh article's price

Parameters

Cart $cart
Currency $currency

at line 302
findCartItem( CartEvent $event)

Find a specific record in CartItem table using the current CartEvent

Parameters

CartEvent $event the cart event

at line 321
restoreCurrentCart( CartRestoreEvent $cartRestoreEvent, $eventName, EventDispatcherInterface $dispatcher)

Search if cart already exists in session. If not try to restore it from the cart cookie, or duplicate an old one.

Parameters

CartRestoreEvent $cartRestoreEvent
$eventName
EventDispatcherInterface $dispatcher

at line 448
createEmptyCart( CartCreateEvent $cartCreateEvent)

Create a new, empty cart object, and assign it to the current customer, if any.

Parameters

CartCreateEvent $cartCreateEvent

at line 514
static getSubscribedEvents()

{@inheritdoc}