class MemoryDecorator implements RouteRepository

Class MemoryDecorator

Properties

protected RouteRepository $repo Repository instance
protected array $mapBySiteKey Map consist of route item by site key
protected array $mapByInstanceId Map consist of route item by instance identifier
protected array $mapByModule Map consist of route item by module name

Methods

__construct(RouteRepository $repo)

MemoryDecorator constructor.

all()

Returns all route items

findByUrlAndSiteKey(string $url, string $siteKey)

Retrieve a route by url segment and site key

findByInstanceId(string $instanceId)

Retrieve a route by instance identifier

fetchBySiteKey(string $siteKey)

Retrieve routes by site key

fetchByModule(string $module)

Retrieve routes by module name

create(array $input)

Save a new route item and return the instance

put(InstanceRoute $route)

Save the route item

bool|null
delete(InstanceRoute $route)

Delete the route item from the repository

void
setToMap(InstanceRoute $route)

Set a route item to map

void
setToSiteKeyMap(InstanceRoute $route)

Set a route item to site key map

void
setToModuleMap(InstanceRoute $route)

Set a route item to module map

void
setToInstanceIdMap(InstanceRoute $route)

Set a route item to instance map

void
unsetFromMap(InstanceRoute $route)

Unset a route item from map

void
unsetFromSiteKeyMap(InstanceRoute $route)

Unset a route item from site key map

void
unsetFromModuleMap(InstanceRoute $route)

Unset a route item from module map

void
unsetFromInstanceIdMap(InstanceRoute $route)

Unset a route item from instance map

Details

at line 65
__construct(RouteRepository $repo)

MemoryDecorator constructor.

Parameters

RouteRepository $repo Repository instance

at line 75
InstanceRoute[] all()

Returns all route items

Return Value

InstanceRoute[]

at line 93
InstanceRoute findByUrlAndSiteKey(string $url, string $siteKey)

Retrieve a route by url segment and site key

Parameters

string $url first segment of url
string $siteKey site key

Return Value

InstanceRoute

at line 112
InstanceRoute findByInstanceId(string $instanceId)

Retrieve a route by instance identifier

Parameters

string $instanceId instance identifier

Return Value

InstanceRoute

at line 131
InstanceRoute[] fetchBySiteKey(string $siteKey)

Retrieve routes by site key

Parameters

string $siteKey site key

Return Value

InstanceRoute[]

at line 150
InstanceRoute[] fetchByModule(string $module)

Retrieve routes by module name

Parameters

string $module module name

Return Value

InstanceRoute[]

at line 169
InstanceRoute create(array $input)

Save a new route item and return the instance

Parameters

array $input route item attributes

Return Value

InstanceRoute

at line 183
InstanceRoute put(InstanceRoute $route)

Save the route item

Parameters

InstanceRoute $route route instance

Return Value

InstanceRoute

at line 197
bool|null delete(InstanceRoute $route)

Delete the route item from the repository

Parameters

InstanceRoute $route route instance

Return Value

bool|null

at line 210
protected void setToMap(InstanceRoute $route)

Set a route item to map

Parameters

InstanceRoute $route route item instance

Return Value

void

at line 223
protected void setToSiteKeyMap(InstanceRoute $route)

Set a route item to site key map

Parameters

InstanceRoute $route route item instance

Return Value

void

at line 238
protected void setToModuleMap(InstanceRoute $route)

Set a route item to module map

Parameters

InstanceRoute $route route item instance

Return Value

void

at line 253
protected void setToInstanceIdMap(InstanceRoute $route)

Set a route item to instance map

Parameters

InstanceRoute $route route item instance

Return Value

void

at line 264
protected void unsetFromMap(InstanceRoute $route)

Unset a route item from map

Parameters

InstanceRoute $route route item instance

Return Value

void

at line 277
protected void unsetFromSiteKeyMap(InstanceRoute $route)

Unset a route item from site key map

Parameters

InstanceRoute $route route item instance

Return Value

void

at line 290
protected void unsetFromModuleMap(InstanceRoute $route)

Unset a route item from module map

Parameters

InstanceRoute $route route item instance

Return Value

void

at line 303
protected void unsetFromInstanceIdMap(InstanceRoute $route)

Unset a route item from instance map

Parameters

InstanceRoute $route route item instance

Return Value

void