protected function detectSubsiteId(HTTPRequest $request)
    {
        if ($request->getVar('SubsiteID') !== null) {
            return (int) $request->getVar('SubsiteID');
        }

        if (SubsiteState::singleton()->getUseSessions() && $request->getSession()->get('SubsiteID') !== null) {
            return (int) $request->getSession()->get('SubsiteID');
        }

        $subsiteIdFromDomain = Subsite::getSubsiteIDForDomain();
        if ($subsiteIdFromDomain !== null) {
            return (int) $subsiteIdFromDomain;
        }

        // Default fallback
        return 0;
    }
protected function detectSubsiteId(HTTPRequest $request)
    {
        if ($request->getVar('SubsiteID') !== null) {
            return (int) $request->getVar('SubsiteID');
        }

        if (SubsiteState::singleton()->getUseSessions() && $request->getSession()->get('SubsiteID') !== null) {
            return (int) $request->getSession()->get('SubsiteID');
        }

        $subsiteIdFromDomain = Subsite::getSubsiteIDForDomain();
        if ($subsiteIdFromDomain !== null) {
            return (int) $subsiteIdFromDomain;
        }

        // Default fallback
        return 0;
    }
protected function detectSubsiteId ( HTTPRequest $ request ) { if ( $ request -> getVar ( 'SubsiteID' ) !== null ) { return ( int ) $ request -> getVar ( 'SubsiteID' ) ; } if ( SubsiteState :: singleton ( ) -> getUseSessions ( ) && $ request -> getSession ( ) -> get ( 'SubsiteID' ) !== null ) { return ( int ) $ request -> getSession ( ) -> get ( 'SubsiteID' ) ; } $ subsiteIdFromDomain = Subsite :: getSubsiteIDForDomain ( ) ; if ( $ subsiteIdFromDomain !== null ) { return ( int ) $ subsiteIdFromDomain ; } // Default fallback return 0 ; }
Use the given request to detect the current subsite ID

@param  HTTPRequest $request
@return int
Use the given request to detect the current subsite ID