public function addSiteAliasUrls($idSite, $urls)
    {
        Piwik::checkUserHasAdminAccess($idSite);

        if (empty($urls)) {
            return 0;
        }

        if (!is_array($urls)) {
            $urls = array($urls);
        }

        $urlsInit = $this->getSiteUrlsFromId($idSite);
        $toInsert = array_merge($urlsInit, $urls);

        $urlsProperty = new Urls($idSite);
        $urlsProperty->setValue($toInsert);
        $urlsProperty->save();

        $inserted = array_diff($urlsProperty->getValue(), $urlsInit);

        $this->postUpdateWebsite($idSite);

        return count($inserted);
    }
public function addSiteAliasUrls($idSite, $urls)
    {
        Piwik::checkUserHasAdminAccess($idSite);

        if (empty($urls)) {
            return 0;
        }

        if (!is_array($urls)) {
            $urls = array($urls);
        }

        $urlsInit = $this->getSiteUrlsFromId($idSite);
        $toInsert = array_merge($urlsInit, $urls);

        $urlsProperty = new Urls($idSite);
        $urlsProperty->setValue($toInsert);
        $urlsProperty->save();

        $inserted = array_diff($urlsProperty->getValue(), $urlsInit);

        $this->postUpdateWebsite($idSite);

        return count($inserted);
    }
public function addSiteAliasUrls ( $ idSite , $ urls ) { Piwik :: checkUserHasAdminAccess ( $ idSite ) ; if ( empty ( $ urls ) ) { return 0 ; } if ( ! is_array ( $ urls ) ) { $ urls = array ( $ urls ) ; } $ urlsInit = $ this -> getSiteUrlsFromId ( $ idSite ) ; $ toInsert = array_merge ( $ urlsInit , $ urls ) ; $ urlsProperty = new Urls ( $ idSite ) ; $ urlsProperty -> setValue ( $ toInsert ) ; $ urlsProperty -> save ( ) ; $ inserted = array_diff ( $ urlsProperty -> getValue ( ) , $ urlsInit ) ; $ this -> postUpdateWebsite ( $ idSite ) ; return count ( $ inserted ) ; }
Add a list of alias Urls to the given idSite

If some URLs given in parameter are already recorded as alias URLs for this website,
they won't be duplicated. The 'main_url' of the website won't be affected by this method.

@param int $idSite
@param array|string $urls When calling API via HTTP specify multiple URLs via `&urls[]=http...&urls[]=http...`.
@return int the number of inserted URLs
Add a list of alias Urls to the given idSite