CartService
in package
FinalYes
Decides which storage (session or DB) holds items, vouchers and checkout; nothing more.
No business logic (held by CartManager) and no
calls to other models/managers: it only passes to the injected CartMapperInterface,
whose concrete variant CartMapperFactory selects by %eshop.cart.storage%.
Table of Contents
Properties
Methods
- __construct() : mixed
- load() : CartSnapshot
- save() : void
Properties
$mapper read-only
private
CartMapperInterface
$mapper
Methods
__construct()
public
__construct(CartMapperInterface $mapper) : mixed
Parameters
- $mapper : CartMapperInterface
load()
public
load(int|null $userId) : CartSnapshot
Parameters
- $userId : int|null
Return values
CartSnapshotsave()
public
save(int|null $userId, CartSnapshot $snapshot) : void
Parameters
- $userId : int|null
- $snapshot : CartSnapshot