Ticket #542 (closed defect: fixed)
engine-slug option for aRoute and aDoctrineRoute should not require an additional query
| Reported by: | dordille | Owned by: | dordille |
|---|---|---|---|
| Priority: | blocker | Milestone: | 1.5 |
| Component: | apostrophePlugin | Version: | |
| Keywords: | aRoute, aDoctrineRoute | Cc: | |
| Symfony version: | 1.4 |
Description
aRoute and aDoctrineRoute both support the engine-slug option however this is impractical to use due to performance hits in fetching the corresponding engine every time a link is made.
From aRouteTools
static public function pushTargetEnginePage($page)
{
if (!(is_object($page) && ($page instanceof aPage)))
{
$page = aPageTable::retrieveBySlug($page);
}
self::$targetEnginePages[$page->engine][] = $page;
}
addPageToUrl currently expects the targetEnginePages cache to be an array of objects. The solution seems to be to allow the $targetEnginePages cache accept slugs. For backwards compatibility with 1.4 the cache should also allow aPage objects.
Change History
Note: See
TracTickets for help on using
tickets.

