No way for adapter to revert its route to a primary route
dantleech opened this issue · 2 comments
dantleech commented
The adapter should also handle updating the type of the route back to a primary route.
Currently this is handled by the AutoRouteInterface#setType
method, however the AutoRoute
should not know how the adapter stores the "type" information:
// AutoRouteManager.php
$autoRoute = $existingRoute;
$autoRoute->setType(AutoRouteInterface::TYPE_PRIMARY);
This should be delegated to the adapter:
$this->adapter->resetToPrimary($autoRoute);
dantleech commented
Hmm, the same might also apply to setRedirectTarget
, which is scoped only to the adapter.
dantleech commented
Closing this as it is my use case here was solved more effectively by using a custom AutoRoute object (which falls within the scope of the custom adapter).