Magento: Loading a store by store_id

Sometimes there is a need to load a store from the store id, this is not hard to do once you find the right function.

Mage::getModel('core/store')->load($storeId); //a store object

A store object might look like this. Each of the data has a get and a set fucntion (so getIsActive() returns if the store is active or not)

 
 
Mage_Core_Model_Store Object
(
    [_cacheTag:protected] => 1
    [_eventPrefix:protected] => store
    [_eventObject:protected] => store
    [_priceFilter:protected] => 
    [_website:protected] => 
    [_group:protected] => 
    [_configCache:protected] => 
    [_configCacheBaseNodes:protected] => Array
        (
            [0] => catalog/price/scope
            [1] => web/secure/base_url
            [2] => web/secure/use_in_adminhtml
            [3] => web/secure/use_in_frontend
            [4] => web/url/use_store
            [5] => web/unsecure/base_url
            [6] => web/seo/use_rewrites
            [7] => web/unsecure/base_link_url
            [8] => web/secure/base_link_url
            [9] => general/locale/code
        )
 
    [_dirCache:protected] => Array()
 
    [_urlCache:protected] => Array()
 
    [_baseUrlCache:protected] => Array()
 
    [_session:protected] => 
    [_isAdminSecure:protected] => 
    [_isFrontSecure:protected] => 
    [_isReadOnly:private] => 
    [_resourceName:protected] => core/store
    [_resource:protected] => 
    [_resourceCollectionName:protected] => core/store_collection
    [_dataSaveAllowed:protected] => 1
    [_data:protected] => Array
        (
            [store_id] => 64
            [code] => mystore
            [website_id] => 1
            [group_id] => 25
            [name] => mystore
            [sort_order] => 0
            [is_active] => 1
        )
 
    [_origData:protected] => Array
        (
            [store_id] => 64
            [code] => mystore
            [website_id] => 1
            [group_id] => 25
            [name] => mystore
            [sort_order] => 0
            [is_active] => 1
        )
 
    [_idFieldName:protected] => 
    [_isDeleted:protected] => 
)

An an example code to find if the store with id 5 is active or not

if (Mage::getModel('core/store')->load($storeId)->getIsActive())
    //do something if we are active
else
    //do something else if the store is not active