CartRepository
in package
FinalYes
Raw access to items, vouchers and checkout in the Nette session, section `eshop.cart`.
No business logic and no translation to CartSnapshot
(done by CartMapper one layer up); it only
reads and writes raw PHP values exactly as they lie in the session. Front repository over
the Nette session, like App\UI\Front\System\Models\Repositories\Session\AuthStorageRepository.
Table of Contents
Constants
- KEY_CHECKOUT : string = 'checkout'
- KEY_ITEMS : string = 'items'
- KEY_VOUCHERS : string = 'vouchers'
- SECTION : string = 'eshop.cart'
Properties
- $session : Session
Methods
- __construct() : mixed
- load() : array{items: mixed, vouchers: mixed, checkout: mixed}
- save() : void
- section() : SessionSection
Constants
KEY_CHECKOUT
private
string
KEY_CHECKOUT
= 'checkout'
KEY_ITEMS
private
string
KEY_ITEMS
= 'items'
KEY_VOUCHERS
private
string
KEY_VOUCHERS
= 'vouchers'
SECTION
private
string
SECTION
= 'eshop.cart'
Properties
$session read-only
private
Session
$session
Methods
__construct()
public
__construct(Session $session) : mixed
Parameters
- $session : Session
load()
public
load() : array{items: mixed, vouchers: mixed, checkout: mixed}
Return values
array{items: mixed, vouchers: mixed, checkout: mixed} —raw (unsanitized) data
save()
public
save(array<int, int> $items, array<int, string> $vouchers, array<string, mixed> $checkout) : void
Parameters
- $items : array<int, int>
- $vouchers : array<int, string>
- $checkout : array<string, mixed>
section()
private
section() : SessionSection