PHP Class Backend\Modules\Locale\Engine\Model

Afficher le fichier Open project: forkcms/forkcms Class Usage Examples

Méthodes publiques

Méthode Description
buildCache ( string $language, string $application ) Build the language files
buildURLQueryByFilter ( array $filter ) : string Build a query for the URL based on the filter
createXMLForExport ( array $items ) : string Create an XML-string that can be used for export.
delete ( array $ids ) Delete (multiple) items from locale
exists ( integer $id ) : boolean Does an id exist.
existsByName ( string $name, string $type, string $module, string $language, string $application, integer $id = null ) : boolean Does a locale exists by its name.
get ( integer $id ) : array Get a single item from locale.
getByName ( string $name, string $type, string $module, string $language, string $application ) : boolean Get a locale by its name
getLanguagesForMultiCheckbox ( boolean $includeInterfaceLanguages = false ) : array Get the languages for a multicheckbox.
getTranslations ( string $application, string $module, array $types, array $languages, string $name, string $value ) : array Get the translations
getTypeName ( string $type ) : string Get full type name.
getTypesForDropDown ( ) : array Get all locale types.
getTypesForMultiCheckbox ( ) : array Get all locale types for a multicheckbox.
importXML ( SimpleXMLElement $xml, boolean $overwriteConflicts = false, array $frontendLanguages = null, array $backendLanguages = null, integer $userId = null, integer $date = null ) : array Import a locale XML file.
insert ( array $item ) : integer Insert a new locale item.
update ( array $item ) Update a locale item.

Method Details

buildCache() public static méthode

Build the language files
public static buildCache ( string $language, string $application )
$language string The language to build the locale-file for.
$application string The application to build the locale-file for.

buildURLQueryByFilter() public static méthode

Build a query for the URL based on the filter
public static buildURLQueryByFilter ( array $filter ) : string
$filter array The filter.
Résultat string

createXMLForExport() public static méthode

Create an XML-string that can be used for export.
public static createXMLForExport ( array $items ) : string
$items array The items.
Résultat string

delete() public static méthode

Delete (multiple) items from locale
public static delete ( array $ids )
$ids array The id(s) to delete.

exists() public static méthode

Does an id exist.
public static exists ( integer $id ) : boolean
$id integer The id to check for existence.
Résultat boolean

existsByName() public static méthode

Does a locale exists by its name.
public static existsByName ( string $name, string $type, string $module, string $language, string $application, integer $id = null ) : boolean
$name string The name of the locale.
$type string The type of the locale.
$module string The module wherein will be searched.
$language string The language to use.
$application string The application wherein will be searched.
$id integer The id to exclude in the check.
Résultat boolean

get() public static méthode

Get a single item from locale.
public static get ( integer $id ) : array
$id integer The id of the item to get.
Résultat array

getByName() public static méthode

Get a locale by its name
public static getByName ( string $name, string $type, string $module, string $language, string $application ) : boolean
$name string The name of the locale.
$type string The type of the locale.
$module string The module wherein will be searched.
$language string The language to use.
$application string The application wherein will be searched.
Résultat boolean

getLanguagesForMultiCheckbox() public static méthode

Get the languages for a multicheckbox.
public static getLanguagesForMultiCheckbox ( boolean $includeInterfaceLanguages = false ) : array
$includeInterfaceLanguages boolean Should we also get the interfacelanguages?
Résultat array

getTranslations() public static méthode

Get the translations
public static getTranslations ( string $application, string $module, array $types, array $languages, string $name, string $value ) : array
$application string The application.
$module string The module.
$types array The types of the translations to get.
$languages array The languages of the translations to get.
$name string The name.
$value string The value.
Résultat array

getTypeName() public static méthode

Get full type name.
public static getTypeName ( string $type ) : string
$type string The type of the locale.
Résultat string

getTypesForDropDown() public static méthode

Get all locale types.
public static getTypesForDropDown ( ) : array
Résultat array

getTypesForMultiCheckbox() public static méthode

Get all locale types for a multicheckbox.
public static getTypesForMultiCheckbox ( ) : array
Résultat array

importXML() public static méthode

Import a locale XML file.
public static importXML ( SimpleXMLElement $xml, boolean $overwriteConflicts = false, array $frontendLanguages = null, array $backendLanguages = null, integer $userId = null, integer $date = null ) : array
$xml SimpleXMLElement The locale XML.
$overwriteConflicts boolean Should we overwrite when there is a conflict?
$frontendLanguages array The frontend languages to install locale for.
$backendLanguages array The backend languages to install locale for.
$userId integer Id of the user these translations should be inserted for.
$date integer The date the translation has been inserted.
Résultat array The import statistics

insert() public static méthode

Insert a new locale item.
public static insert ( array $item ) : integer
$item array The data to insert.
Résultat integer

update() public static méthode

Update a locale item.
public static update ( array $item )
$item array The new data.