Copied!

RegionServiceInterface

RegionServiceInterface.php : 19

The region service is used to manage regions in the context of storefront.

Tags
See
RegionServiceInterface
See
RegionResolverInterface

Methods

publicgetAvailableRegions()

RegionServiceInterface.php : 26

Returns list of the regions assigned to the storefront.

public getAvailableRegions() : iterable<string|int, RegionInterface>

Return values

iterable<string|int, RegionInterface>

publicgetSessionRegion()

RegionServiceInterface.php : 35

Get the region used in the current user session (or null if not set).

public getSessionRegion() : RegionInterface|null

Region stored in the session is usually manually selected by user and has higher priority than "default" region.

Return values

RegionInterface|null

Tags
Throws
NotFoundException

publicisAcceptable()

RegionServiceInterface.php : 47

Checks if the region can be used in the current storefront.

public isAcceptable(RegionInterface $region) : bool

Parameters

Name Type Default value Description
$region RegionInterface - -

Return values

bool

publicsetSessionRegion()

RegionServiceInterface.php : 42

Sets the region to be used for a current user session.

public setSessionRegion(RegionInterface|null $region) : void

Region stored in the session is usually manually selected by user and has higher priority than "default" region.

Parameters

Name Type Default value Description
$region RegionInterface|null - -