/** * Get the page. * * @return PageModel|null */ private function getPage() { $page = $this->pageProvider->getPage(); if ($page) { return $this->i18n->getBasePage($page) ?: $page; } return null; }
/** * Set the routing information. * * @param ModuleModel $model Module model. * * @return void */ private function setRouting(ModuleModel $model) { $config = (array) $this->supportedTypes['modules'][$model->type]; foreach ($config as $field) { $pageId = $model->{$field}; $page = $this->i18n->getTranslatedPage($pageId); if ($page && $page->id != $pageId) { // Detach model so that dynamically changed value does not get stored in db. $model->detach(); $model->{$field} = $page->id; } } }