CartMapper
in package
implements
CartMapperInterface
FinalYes
Session variant of the cart mapper.
$userId is ignored: an anonymous cart survives login by itself because regenerateId()
keeps the section data (see CartManager).
Table of Contents
Interfaces
- CartMapperInterface
- Translates between the raw storage (session section or Api wire payload) and {@see CartSnapshot}.
Properties
Methods
- __construct() : mixed
- load() : CartSnapshot
- save() : void
Properties
$repository read-only
private
CartRepository
$repository
Methods
__construct()
public
__construct(CartRepository $repository) : mixed
Parameters
- $repository : CartRepository
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