/** * Set the list of alias Urls for the given idSite * * Completely overwrites the current list of URLs with the provided list. * The 'main_url' of the website won't be affected by this method. * * @return int the number of inserted URLs */ public function setSiteAliasUrls($idSite, $urls = array()) { Piwik::checkUserHasAdminAccess($idSite); $mainUrl = Site::getMainUrlFor($idSite); array_unshift($urls, $mainUrl); $urlsProperty = new Urls($idSite); $urlsProperty->setValue($urls); $urlsProperty->save(); $inserted = array_diff($urlsProperty->getValue(), $urls); $this->postUpdateWebsite($idSite); return count($inserted); }