phpDocumentor

LanguageProvider
in package
implements LanguageProviderInterface

Class LanguageProvider

Tags
category

System

Interfaces, Classes and Traits

LanguageProviderInterface
Interface LanguageProviderInterface

Table of Contents

$db  : CI_DB_query_builder
Database connection.
__construct()  : mixed
LanguageProvider constructor.
getActiveCodes()  : KeyValueCollection
Returns the active language codes.
getAdminCodes()  : KeyValueCollection
Returns the language codes for languages enabled for administration
getAdminIds()  : IdCollection
Returns the language IDs for languages enabled for administrative purposes.
getCharsetByCode()  : string
Returns the charset from the a specific language, selected by the language code.
getCharsetById()  : string
Returns the charset from the a specific language, selected by the language ID.
getCodeById()  : LanguageCode
Returns the language code from a specific language, selected by the language ID.
getCodes()  : KeyValueCollection
Returns the language codes.
getDefaultLanguageCode()  : string
Returns the default language code.
getDefaultLanguageId()  : int
Returns the default language ID.
getDirectoryByCode()  : string
Returns the directory from the a specific language, selected by the language code.
getDirectoryById()  : string
Returns the directory from the a specific language, selected by the language ID.
getIconFilenameByCode()  : string
Returns the icon for a specific language by a given language code.
getIdByCode()  : int
Returns the ID from the a specific language, selected by the language code.
getIdByDirectory()  : int
Returns the language id of the provided directory name.
getIds()  : IdCollection
Returns the language IDs.

Properties

Methods

__construct()

LanguageProvider constructor.

public __construct(CI_DB_query_builder $db) : mixed
Parameters
$db : CI_DB_query_builder

Database connection.

Return values
mixed

getAdminIds()

Returns the language IDs for languages enabled for administrative purposes.

public getAdminIds() : IdCollection
Tags
throws
InvalidArgumentException

If ID is not valid.

throws
UnexpectedValueException

If no ID has been found.

Return values
IdCollection

getCharsetByCode()

Returns the charset from the a specific language, selected by the language code.

public getCharsetByCode(LanguageCode $code) : string
Parameters
$code : LanguageCode

Language code.

Tags
throws
UnexpectedValueException

If no directory has been found.

Return values
string

getCharsetById()

Returns the charset from the a specific language, selected by the language ID.

public getCharsetById(IdType $id) : string
Parameters
$id : IdType

Language ID.

Tags
throws
UnexpectedValueException

If no charset has been found.

Return values
string

getCodeById()

Returns the language code from a specific language, selected by the language ID.

public getCodeById(IdType $id) : LanguageCode
Parameters
$id : IdType

Language ID.

Tags
throws
InvalidArgumentException

If code is not valid.

throws
UnexpectedValueException

If no code has been found.

Return values
LanguageCode

getDefaultLanguageCode()

Returns the default language code.

public getDefaultLanguageCode() : string
Tags
throws
InvalidArgumentException

If no default code exists.

Return values
string

getDefaultLanguageId()

Returns the default language ID.

public getDefaultLanguageId() : int
Tags
throws
InvalidArgumentException

If no default code exists.

Return values
int

getDirectoryByCode()

Returns the directory from the a specific language, selected by the language code.

public getDirectoryByCode(LanguageCode $code) : string
Parameters
$code : LanguageCode

Language code.

Tags
throws
UnexpectedValueException

If no directory has been found.

Return values
string

getDirectoryById()

Returns the directory from the a specific language, selected by the language ID.

public getDirectoryById(IdType $id) : string
Parameters
$id : IdType

Language ID.

Tags
throws
InvalidArgumentException

If code is not valid.

throws
UnexpectedValueException

If no directory has been found.

Return values
string

getIconFilenameByCode()

Returns the icon for a specific language by a given language code.

public getIconFilenameByCode(LanguageCode $code) : string
Parameters
$code : LanguageCode

The given language code

Tags
throws
UnexpectedValueException

If no icon has been found.

Return values
string

getIdByCode()

Returns the ID from the a specific language, selected by the language code.

public getIdByCode(LanguageCode $code) : int
Parameters
$code : LanguageCode

Language code.

Tags
throws
UnexpectedValueException

If no ID has been found.

Return values
int

getIdByDirectory()

Returns the language id of the provided directory name.

public getIdByDirectory(StringType $directory) : int
Parameters
$directory : StringType

Name of directory.

Tags
throws
UnexpectedValueException

If no id was found by provided directory.

Return values
int

getIds()

Returns the language IDs.

public getIds() : IdCollection
Tags
throws
InvalidArgumentException

If ID is not valid.

throws
UnexpectedValueException

If no ID has been found.

Return values
IdCollection

Search results