If several articles were linked in the menu, this led to a lot of SQL queries.
return $this->handler;
}
+
+ public function cachePageObject(): void
+ {
+ if ($this->pageObjectID && $this->getMenuPageHandler() !== null) {
+ $this->getMenuPageHandler()->cacheObject($this->pageObjectID);
+ }
+ }
}
// build menu structure
foreach ($menuItemList as $menuItem) {
+ $menuItem->cachePageObject();
+
$this->menuItems[$menuItem->itemID] = $menuItem;
if (!isset($this->menuItemStructure[$menuItem->parentItemID])) {
{
return true;
}
+
+ /**
+ * @inheritDoc
+ */
+ public function cacheObject(int $objectID): void
+ {
+ }
}
ViewableArticleContentRuntimeCache::getInstance()->cacheObjectID($user->pageObjectID);
}
}
+
+ /**
+ * @inheritDoc
+ */
+ public function cacheObject(int $objectID): void
+ {
+ ViewableArticleRuntimeCache::getInstance()->cacheObjectID($objectID);
+ }
}
* @return bool false if the page should be hidden from menus
*/
public function isVisible($objectID = null);
+
+ /**
+ * Caches the given object id to save SQL queries if multiple objects of the same type are queried in the menu.
+ *
+ * @since 6.0
+ */
+ public function cacheObject(int $objectID): void;
}