PHP Class Xpressengine\Site\SiteHandler

## app binding * xe.site 으로 바인딩 되어 있음 * XeSite Facade 제공 ## 사용법 ### 현재의 Site 객체를 획득 php XeSite::getCurrentSite() ### 현재의 Site 객체를 지정 php XeSite::setCurrentSite(Site $site) ### 현재의 SiteKey 획득 * 현재 사이트 객체에서 사이트 키를 가져옴. * 편의를 위해서 제공 php XeSite::getCurrentSiteKey() ### Site 의 ConfigEntity 획득 * siteKey 에 해당하는 설정 정보 가져옴 * siteKey 를 전달하지 않는 경우에는 defaultSiteKey 가 적용됨 php XeSite::getSiteConfig($siteKey = null) ### Site 의 ConfigEntity 업데이트 * siteKey 에 해당하는 ConfigEntity 수정 php XeSite::putSiteConfig(ConfigEntity $config)
Author: XE Developers ([email protected])
Mostra file Open project: xpressengine/xpressengine Class Usage Examples

Protected Properties

Property Type Description
$config Xpressengine\Config\ConfigManager
$currentSite Site
$model

Public Methods

Method Description
__construct ( ConfigManager $config ) SiteHandler constructor.
add ( array $inputs ) : Site add
createModel ( ) : string Create new site model
getCurrentSite ( ) : Site getCurrentSite
getCurrentSiteKey ( ) : string getCurrentSiteKey
getDefaultMenuEntityId ( null | string $siteKey = null ) : string getDefaultMenuEntityId
getHomeInstanceId ( null | string $siteKey = null ) : string getHomeInstanceId
getModel ( ) : string Get site model
getSiteConfig ( string | null $siteKey = null ) : ConfigEntity getSiteConfig
getSiteConfigValue ( string $key, string | null $siteKey = null ) : string getSiteConfigValue
put ( Site $site ) : Site put
putSiteConfig ( ConfigEntity $config ) : void putSiteConfig
remove ( string $host ) : void remove
setCurrentSite ( Site $site ) : void setCurrentSite
setDefaultMenuEntityId ( string $menuId, null | string $siteKey = null ) : string setDefaultMenuEntityId
setHomeInstanceId ( string $instanceId, null | string $siteKey = null ) : string setHomeInstanceId
setModel ( string $model ) : void Set site model

Protected Methods

Method Description
checkUsableDomain ( string $host ) : void checkUsableDomain

Method Details

__construct() public method

SiteHandler constructor.
public __construct ( ConfigManager $config )
$config Xpressengine\Config\ConfigManager xpressengine config manager

add() public method

add
public add ( array $inputs ) : Site
$inputs array input array
return Site

checkUsableDomain() protected method

checkUsableDomain
protected checkUsableDomain ( string $host ) : void
$host string site host
return void

createModel() public method

Create new site model
public createModel ( ) : string
return string

getCurrentSite() public method

getCurrentSite
public getCurrentSite ( ) : Site
return Site

getCurrentSiteKey() public method

getCurrentSiteKey
public getCurrentSiteKey ( ) : string
return string

getDefaultMenuEntityId() public method

getDefaultMenuEntityId
public getDefaultMenuEntityId ( null | string $siteKey = null ) : string
$siteKey null | string site key
return string

getHomeInstanceId() public method

getHomeInstanceId
public getHomeInstanceId ( null | string $siteKey = null ) : string
$siteKey null | string site key
return string

getModel() public method

Get site model
public getModel ( ) : string
return string

getSiteConfig() public method

getSiteConfig
public getSiteConfig ( string | null $siteKey = null ) : ConfigEntity
$siteKey string | null site key
return Xpressengine\Config\ConfigEntity

getSiteConfigValue() public method

getSiteConfigValue
public getSiteConfigValue ( string $key, string | null $siteKey = null ) : string
$key string value key
$siteKey string | null site key
return string

put() public method

put
public put ( Site $site ) : Site
$site Site site object
return Site

putSiteConfig() public method

putSiteConfig
public putSiteConfig ( ConfigEntity $config ) : void
$config Xpressengine\Config\ConfigEntity site config entity
return void

remove() public method

remove
public remove ( string $host ) : void
$host string site host
return void

setCurrentSite() public method

setCurrentSite
public setCurrentSite ( Site $site ) : void
$site Site site
return void

setDefaultMenuEntityId() public method

setDefaultMenuEntityId
public setDefaultMenuEntityId ( string $menuId, null | string $siteKey = null ) : string
$menuId string MenuEntity id
$siteKey null | string site key
return string

setHomeInstanceId() public method

setHomeInstanceId
public setHomeInstanceId ( string $instanceId, null | string $siteKey = null ) : string
$instanceId string menu item instance id
$siteKey null | string site key
return string

setModel() public method

Set site model
public setModel ( string $model ) : void
$model string model class
return void

Property Details

$config protected_oe property

protected ConfigManager,Xpressengine\Config $config
return Xpressengine\Config\ConfigManager

$currentSite protected_oe property

protected Site,Xpressengine\Site $currentSite
return Site

$model protected_oe property

protected $model