PHP Class Pimcore\Model\Translation\AbstractTranslation

Inheritance: extends Pimcore\Model\AbstractModel, implements Pimcore\Model\Translation\TranslationInterface
Afficher le fichier Open project: pimcore/pimcore Class Usage Examples

Méthodes publiques

Свойство Type Description
$creationDate integer
$key string
$modificationDate integer
$translations array

Méthodes publiques

Méthode Description
addTranslation ( string $language, string $text )
clearDependentCache ( ) : void
getByKey ( $id, boolean $create = false, boolean $returnIdIfEmpty = false ) : static
getByKeyLocalized ( $id, boolean $create = false, boolean $returnIdIfEmpty = false, $language = null ) : string Static Helper to get the translation of the current locale
getCreationDate ( )
getDate ( ) : integer
getForWebserviceExport ( ) : array
getFromWebserviceImport ( $data )
getKey ( ) : string
getModificationDate ( )
getTranslation ( $language ) : array
getTranslations ( ) : array
importTranslationsFromFile ( $file, boolean $replaceExistingTranslations = true, $languages = null ) Imports translations from a csv file The CSV file has to have the same format as an Pimcore translation-export-file
save ( )
setCreationDate ( $date )
setDate ( $date )
setKey ( $key )
setModificationDate ( $date )
setTranslations ( $translations )

Méthodes protégées

Méthode Description
getValidTranslationKey ( $key ) : string

Method Details

addTranslation() public méthode

public addTranslation ( string $language, string $text )
$language string
$text string

clearDependentCache() public static méthode

public static clearDependentCache ( ) : void
Résultat void

getByKey() public static méthode

public static getByKey ( $id, boolean $create = false, boolean $returnIdIfEmpty = false ) : static
$id
$create boolean
$returnIdIfEmpty boolean
Résultat static

getByKeyLocalized() public static méthode

Static Helper to get the translation of the current locale
public static getByKeyLocalized ( $id, boolean $create = false, boolean $returnIdIfEmpty = false, $language = null ) : string
$id - translation key
$create boolean - creates an empty translation entry if the key doesn't exists
$returnIdIfEmpty boolean - returns $id if no translation is available
Résultat string

getCreationDate() public méthode

public getCreationDate ( )

getDate() public méthode

Deprecation: use getCreationDate or getModificationDate instead
public getDate ( ) : integer
Résultat integer

getForWebserviceExport() public méthode

public getForWebserviceExport ( ) : array
Résultat array

getFromWebserviceImport() public méthode

public getFromWebserviceImport ( $data )
$data

getKey() public méthode

public getKey ( ) : string
Résultat string

getModificationDate() public méthode

public getModificationDate ( )

getTranslation() public méthode

public getTranslation ( $language ) : array
$language
Résultat array

getTranslations() public méthode

public getTranslations ( ) : array
Résultat array

getValidTranslationKey() protected static méthode

protected static getValidTranslationKey ( $key ) : string
$key
Résultat string

importTranslationsFromFile() public static méthode

Imports translations from a csv file The CSV file has to have the same format as an Pimcore translation-export-file
public static importTranslationsFromFile ( $file, boolean $replaceExistingTranslations = true, $languages = null )
$file - path to the csv file
$replaceExistingTranslations boolean

save() public méthode

public save ( )

setCreationDate() public méthode

public setCreationDate ( $date )
$date

setDate() public méthode

public setDate ( $date )
$date

setKey() public méthode

public setKey ( $key )
$key

setModificationDate() public méthode

public setModificationDate ( $date )
$date

setTranslations() public méthode

public setTranslations ( $translations )
$translations

Property Details

$creationDate public_oe property

public int $creationDate
Résultat integer

$key public_oe property

public string $key
Résultat string

$modificationDate public_oe property

public int $modificationDate
Résultat integer

$translations public_oe property

public array $translations
Résultat array