PHP Class Sulu\Component\Localization\Localization

Inheritance: implements JsonSerializable, implements Sulu\Component\Util\ArrayableInterface
Datei anzeigen Open project: sulu/sulu Class Usage Examples

Public Methods

Method Description
__construct ( $language = null, $country = null )
__toString ( ) : string
addChild ( Localization $child ) Adds a new child localization.
findLocalization ( string $localization ) : Localization | null
getAllLocalizations ( ) : Localization[] Returns a list of all localizations and sublocalizations.
getChildren ( ) : Localization[] Returns the children of the localization.
getCountry ( ) : string Returns the country of this localization.
getLanguage ( ) : string Returns the language of this localization.
getLocale ( string $format = self::UNDERSCORE ) : string Returns the localization code, which is a combination of the language and the country in a specific format.
getLocalization ( string $delimiter = '_' ) : string Returns the localization code, which is a combination of the language and the country.
getParent ( ) : Localization Returns the parent of this localization.
getShadow ( ) : string Returns how to handle shadow pages for this localization.
isDefault ( ) : boolean Returns if this localization is the default one.
isXDefault ( ) : boolean Returns if this localization is the x-default one.
jsonSerialize ( )
setChildren ( Localization[] $children ) Sets the children of the localization.
setCountry ( string $country ) Sets the country of this localization.
setDefault ( boolean $default ) Sets if this localization is the default one.
setLanguage ( string $language ) Sets the language of this localization.
setParent ( Localization $parent ) Sets the parent of this localization.
setShadow ( string $shadow ) Sets how to handle shadow pages for this localization.
setXDefault ( boolean $xDefault ) Sets if this localization is the x-default one.
toArray ( $depth = null )

Method Details

__construct() public method

public __construct ( $language = null, $country = null )

__toString() public method

public __toString ( ) : string
return string

addChild() public method

Adds a new child localization.
public addChild ( Localization $child )
$child Localization

findLocalization() public method

public findLocalization ( string $localization ) : Localization | null
$localization string
return Localization | null

getAllLocalizations() public method

Returns a list of all localizations and sublocalizations.
public getAllLocalizations ( ) : Localization[]
return Localization[]

getChildren() public method

Returns the children of the localization.
public getChildren ( ) : Localization[]
return Localization[]

getCountry() public method

Returns the country of this localization.
public getCountry ( ) : string
return string

getLanguage() public method

Returns the language of this localization.
public getLanguage ( ) : string
return string

getLocale() public method

Returns the localization code, which is a combination of the language and the country in a specific format.
public getLocale ( string $format = self::UNDERSCORE ) : string
$format string requested localization format
return string

getLocalization() public method

Returns the localization code, which is a combination of the language and the country.
Deprecation: use getLocale instead
public getLocalization ( string $delimiter = '_' ) : string
$delimiter string between language and country
return string

getParent() public method

Returns the parent of this localization.
public getParent ( ) : Localization
return Localization

getShadow() public method

Returns how to handle shadow pages for this localization.
public getShadow ( ) : string
return string

isDefault() public method

Returns if this localization is the default one.
public isDefault ( ) : boolean
return boolean True if this is the default localization, otherwise false

isXDefault() public method

Returns if this localization is the x-default one.
public isXDefault ( ) : boolean
return boolean True if this is the x-default localization, otherwise false

jsonSerialize() public method

public jsonSerialize ( )

setChildren() public method

Sets the children of the localization.
public setChildren ( Localization[] $children )
$children Localization[]

setCountry() public method

Sets the country of this localization.
public setCountry ( string $country )
$country string

setDefault() public method

Sets if this localization is the default one.
public setDefault ( boolean $default )
$default boolean

setLanguage() public method

Sets the language of this localization.
public setLanguage ( string $language )
$language string

setParent() public method

Sets the parent of this localization.
public setParent ( Localization $parent )
$parent Localization

setShadow() public method

Sets how to handle shadow pages for this localization.
public setShadow ( string $shadow )
$shadow string

setXDefault() public method

Sets if this localization is the x-default one.
public setXDefault ( boolean $xDefault )
$xDefault boolean

toArray() public method

public toArray ( $depth = null )