PHP Class Backend\Modules\Locale\Engine\Model

Datei anzeigen Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method 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 method

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 method

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

createXMLForExport() public static method

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

delete() public static method

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

exists() public static method

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

existsByName() public static method

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.
return boolean

get() public static method

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

getByName() public static method

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.
return boolean

getLanguagesForMultiCheckbox() public static method

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

getTranslations() public static method

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.
return array

getTypeName() public static method

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

getTypesForDropDown() public static method

Get all locale types.
public static getTypesForDropDown ( ) : array
return array

getTypesForMultiCheckbox() public static method

Get all locale types for a multicheckbox.
public static getTypesForMultiCheckbox ( ) : array
return array

importXML() public static method

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.
return array The import statistics

insert() public static method

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

update() public static method

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