public static setSiteFromArray ( $idSite, $infoSite ) | ||
$idSite | ||
$infoSite |
public static function setSiteFromArray($idSite, $infoSite)
{
if (empty($idSite) || empty($infoSite)) {
throw new UnexpectedWebsiteFoundException("An unexpected website was found in the request: website id was set to '{$idSite}' .");
}
self::$infoSites[$idSite] = $infoSite;
}
/** * Returns the website information : name, main_url * * @throws Exception if the site ID doesn't exist or the user doesn't have access to it * @param int $idSite * @return array */ public function getSiteFromId($idSite) { Piwik::checkUserHasViewAccess($idSite); $site = $this->getModel()->getSiteFromId($idSite); Site::setSiteFromArray($idSite, $site); return $site; }