public function getCurrentOrganizationId()
    {
        $orgId = $this->_getVar('user_organization_id');

        //If not set, read it from the cookie
        if ($this->isCurrentUser() && ((null === $orgId) || (\Gems_User_UserLoader::SYSTEM_NO_ORG === $orgId))) {
            $request = $this->getRequest();
            if ($request) {
                $orgId = \Gems_Cookies::getOrganization($this->getRequest());
            }
            if (! $orgId) {
                $orgId = 0;
            }
            $this->_setVar('user_organization_id', $orgId);
        }
        return $orgId;
    }
public function getCurrentOrganizationId()
    {
        $orgId = $this->_getVar('user_organization_id');

        //If not set, read it from the cookie
        if ($this->isCurrentUser() && ((null === $orgId) || (\Gems_User_UserLoader::SYSTEM_NO_ORG === $orgId))) {
            $request = $this->getRequest();
            if ($request) {
                $orgId = \Gems_Cookies::getOrganization($this->getRequest());
            }
            if (! $orgId) {
                $orgId = 0;
            }
            $this->_setVar('user_organization_id', $orgId);
        }
        return $orgId;
    }
public function getCurrentOrganizationId ( ) { $ orgId = $ this -> _getVar ( 'user_organization_id' ) ; //If not set, read it from the cookie if ( $ this -> isCurrentUser ( ) && ( ( null === $ orgId ) || ( \ Gems_User_UserLoader :: SYSTEM_NO_ORG === $ orgId ) ) ) { $ request = $ this -> getRequest ( ) ; if ( $ request ) { $ orgId = \ Gems_Cookies :: getOrganization ( $ this -> getRequest ( ) ) ; } if ( ! $ orgId ) { $ orgId = 0 ; } $ this -> _setVar ( 'user_organization_id' , $ orgId ) ; } return $ orgId ; }
Returns the organization id that is currently used by this user.

@return int
Returns the organization id that is currently used by this user .