PHP Class Pimcore\Model\Translation\AbstractTranslation

Inheritance: extends Pimcore\Model\AbstractModel, implements Pimcore\Model\Translation\TranslationInterface
Datei anzeigen Open project: pimcore/pimcore Class Usage Examples

Public Properties

Property Type Description
$creationDate integer
$key string
$modificationDate integer
$translations array

Public Methods

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

Protected Methods

Method Description
getValidTranslationKey ( $key ) : string

Method Details

addTranslation() public method

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

clearDependentCache() public static method

public static clearDependentCache ( ) : void
return void

getByKey() public static method

public static getByKey ( $id, boolean $create = false, boolean $returnIdIfEmpty = false ) : static
$id
$create boolean
$returnIdIfEmpty boolean
return static

getByKeyLocalized() public static method

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
return string

getCreationDate() public method

public getCreationDate ( )

getDate() public method

Deprecation: use getCreationDate or getModificationDate instead
public getDate ( ) : integer
return integer

getForWebserviceExport() public method

public getForWebserviceExport ( ) : array
return array

getFromWebserviceImport() public method

public getFromWebserviceImport ( $data )
$data

getKey() public method

public getKey ( ) : string
return string

getModificationDate() public method

public getModificationDate ( )

getTranslation() public method

public getTranslation ( $language ) : array
$language
return array

getTranslations() public method

public getTranslations ( ) : array
return array

getValidTranslationKey() protected static method

protected static getValidTranslationKey ( $key ) : string
$key
return string

importTranslationsFromFile() public static method

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 method

public save ( )

setCreationDate() public method

public setCreationDate ( $date )
$date

setDate() public method

public setDate ( $date )
$date

setKey() public method

public setKey ( $key )
$key

setModificationDate() public method

public setModificationDate ( $date )
$date

setTranslations() public method

public setTranslations ( $translations )
$translations

Property Details

$creationDate public_oe property

public int $creationDate
return integer

$key public_oe property

public string $key
return string

$modificationDate public_oe property

public int $modificationDate
return integer

$translations public_oe property

public array $translations
return array