CoolCMS API

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

Properties

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
Return values
SessionSection
On this page

Search results