\Multisites
Contains various multisites utility functions, should be accessed via the {@link inst} method in most cases.
Synopsis
class Multisites
{
- // constants
- const CACHE_KEY = 'multisites_map';
- // members
- private static $inst;
- private static Array $developer_identifiers;
- private static Array $site_features;
- protected $cache;
- protected $map;
- protected $default;
- protected $current;
- // methods
- public static Multisites inst()
- public void __construct()
- public void init()
- public void build()
- public int getDefaultSiteId()
- public Site getDefaultSite()
- public int getCurrentSiteId()
- public Site getCurrentSite()
- public void resetCurrentSite()
- public Site getActiveSite()
- public void setActiveSite()
- public Boolean assetsSubfolderPerSite()
- public array sitesManagedByMember()
Constants
Name | Value |
---|---|
CACHE_KEY | 'multisites_map' |
Members
private
protected
- $cache
- $current
- $default
- $map
Methods
public
- __construct()
- assetsSubfolderPerSite() — Checks to see if we should be using a subfolder in assets for each site.
- build() — Builds a map of hostnames to sites, and writes it to the cache.
- getActiveSite() — Get's the site related to what is currently being edited in the cms If a page or site is being edited, it will look up the site of the sitetree being edited, If a MultisitesAware object is being managed in ModelAdmin, ModelAdmin will have set a Session variable MultisitesModelAdmin_SiteID
- getCurrentSite()
- getCurrentSiteId()
- getDefaultSite()
- getDefaultSiteId()
- init() — Attempts to load the hostname map from the cache, and rebuilds it if it cannot be loaded.
- inst()
- resetCurrentSite() — Reset the currently viewed site
- setActiveSite()
- sitesManagedByMember() — Finds sites that the given member is a "Manager" of A manager is currently defined by a Member who has edit access to a Site Object