symfony-cmf / routing-auto

RoutingAuto component
https://cmf.symfony.com
Other
6 stars 11 forks source link

No way for adapter to revert its route to a primary route #30

Closed dantleech closed 9 years ago

dantleech commented 9 years ago

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 9 years ago

Hmm, the same might also apply to setRedirectTarget, which is scoped only to the adapter.

dantleech commented 9 years ago

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).