class StorefrontSessionManager implements StorefrontSessionInterface (View source)

Properties

protected $channel

The current channel

protected Collection $customerGroups

The collection of customer groups to use.

protected Currency $currency

The current currency

protected Customer $customer

The current customer

Methods

__construct(SessionManager $sessionManager, AuthManager $authManager)

Initialise the manager

forget()

{@inheritDoc}

initCustomerGroups()

{@inheritDoc}

initChannel()

{@inheritDoc}

Customer|null
initCustomer()

{@inheritDoc}

string
getSessionKey()

Return the session key for carts.

setChannel(Channel $channel)

Set the cart session channel.

setCustomer(Customer $customer)

Set the session customer.

Customer|null
getCustomer()

Return the current customer.

setCustomerGroups(Collection $customerGroups)

Set the store front session customer group

setCustomerGroup(CustomerGroup $customerGroup)

Set the Customer Group

resetCustomerGroups()

Reset the customer groups

getChannel()

Return the current channel.

Collection|null
getCustomerGroups()

Return the current customer groups

setCurrency(Currency $currency)

Set the cart session currency.

getCurrency()

Return the current currency.

Details

__construct(SessionManager $sessionManager, AuthManager $authManager)

Initialise the manager

Parameters

SessionManager $sessionManager
AuthManager $authManager

forget()

{@inheritDoc}

initCustomerGroups()

{@inheritDoc}

initChannel()

{@inheritDoc}

Customer|null initCustomer()

{@inheritDoc}

Return Value

Customer|null

string getSessionKey()

Return the session key for carts.

Return Value

string

StorefrontSessionInterface setChannel(Channel $channel)

Set the cart session channel.

Parameters

Channel $channel

Return Value

StorefrontSessionInterface

StorefrontSessionInterface setCustomer(Customer $customer)

Set the session customer.

Parameters

Customer $customer

Return Value

StorefrontSessionInterface

Customer|null getCustomer()

Return the current customer.

Return Value

Customer|null

StorefrontSessionInterface setCustomerGroups(Collection $customerGroups)

Set the store front session customer group

Parameters

Collection $customerGroups

Return Value

StorefrontSessionInterface

StorefrontSessionInterface setCustomerGroup(CustomerGroup $customerGroup)

Set the Customer Group

Parameters

CustomerGroup $customerGroup

Return Value

StorefrontSessionInterface

StorefrontSessionManager resetCustomerGroups()

Reset the customer groups

Channel getChannel()

Return the current channel.

Return Value

Channel

Collection|null getCustomerGroups()

Return the current customer groups

Return Value

Collection|null

StorefrontSessionInterface setCurrency(Currency $currency)

Set the cart session currency.

Parameters

Currency $currency

Return Value

StorefrontSessionInterface

Currency getCurrency()

Return the current currency.

Return Value

Currency