piwik/plugins/SitesManager/API.php
/**
     * Delete a website from the database, given its Id.
     *
     * Requires Super User access.
     *
     * @param int $idSite
     * @throws Exception
     */
Delete a website from the database, given its Id.
Requires Super User access.

@param int $idSite
@throws Exception
Delete a website from the database given its Id . Requires Super User access . @param int $idSite @throws Exception
public function deleteSite($idSite)
    {
        Piwik::checkUserHasSuperUserAccess();
        $idSites = API::getInstance()->getSitesId();
        if (!in_array($idSite, $idSites)) {
            throw new Exception("website id = $idSite not found");
        }
        $nbSites = count($idSites);
        if ($nbSites == 1) {
            throw new Exception(Piwik::translate("SitesManager_ExceptionDeleteSite"));
        }
        $this->getModel()->deleteSite($idSite);
        Piwik::postEvent('SitesManager.deleteSite.end', array($idSite));
    }
public function deleteSite ( $ idSite ) { Piwik :: checkUserHasSuperUserAccess ( ) ; $ idSites = API :: getInstance ( ) -> getSitesId ( ) ; if ( ! in_array ( $ idSite , $ idSites ) ) { throw new Exception ( " website id =  $ idSite  not found " ) ; } $ nbSites = count ( $ idSites ) ; if ( $ nbSites == 1 ) { throw new Exception ( Piwik :: translate ( " SitesManager_ExceptionDeleteSite " ) ) ; } $ this -> getModel ( ) -> deleteSite ( $ idSite ) ; Piwik :: postEvent ( 'SitesManager.deleteSite.end' , array ( $ idSite ) ) ; }
Delete a website from the database, given its Id.
Delete a website from the database given its Id .
/**
         * Triggered after a site has been deleted.
         *
         * Plugins can use this event to remove site specific values or settings, such as removing all
         * goals that belong to a specific website. If you store any data related to a website you
         * should clean up that information here.
         *
         * @param int $idSite The ID of the site being deleted.
         */