/** * return correctl * @param NiceURL $niceUrl * @return null|string */ public function processNiceUrl(NiceURL $niceUrl) { $url = null; $niceUrlObject = $niceUrl->getObject(); if ($niceUrlObject instanceof NiceUrlAdvanced) { return $niceUrlObject->oryginal_url; } $url = sprintf('%s/%s/%s', $niceUrlObject->getNiceUrlModuleName(), $niceUrlObject->getNiceUrlControllerId(), $niceUrlObject->getNiceUrlModuleAction()); return $url; }
/** * @param Language $language * @param string $route * @return NiceUrl|null */ public function findNiceUrlForRequest(Language $language, $route) { /** @var NiceUrl $niceUrl */ $niceUrl = NiceURL::findOne(['url' => $route, 'language_id' => $language->id]); return $niceUrl; }