PHP Class creocoder\translateable\TranslateableBehavior

Author: Alexander Kochetov ([email protected])
Inheritance: extends yii\base\Behavior
Afficher le fichier Open project: creocoder/yii2-translateable Class Usage Examples

Méthodes publiques

Свойство Type Description
$translationAttributes the list of attributes to be translated
$translationLanguageAttribute the translations model language attribute name
$translationRelation the translations relation name

Méthodes publiques

Méthode Description
__get ( $name )
__set ( $name, $value )
afterSave ( ) : void
afterValidate ( ) : void
canGetProperty ( $name, $checkVars = true )
canSetProperty ( $name, $checkVars = true )
events ( )
getTranslation ( string | null $language = null ) : ActiveRecord Returns the translation model for the specified language.
hasTranslation ( string | null $language = null ) : boolean Returns a value indicating whether the translation model for the specified language exists.
init ( )
translate ( string | null $language = null ) : ActiveRecord Returns the translation model for the specified language.

Method Details

__get() public méthode

public __get ( $name )

__set() public méthode

public __set ( $name, $value )

afterSave() public méthode

public afterSave ( ) : void
Résultat void

afterValidate() public méthode

public afterValidate ( ) : void
Résultat void

canGetProperty() public méthode

public canGetProperty ( $name, $checkVars = true )

canSetProperty() public méthode

public canSetProperty ( $name, $checkVars = true )

events() public méthode

public events ( )

getTranslation() public méthode

Returns the translation model for the specified language.
public getTranslation ( string | null $language = null ) : ActiveRecord
$language string | null
Résultat yii\db\ActiveRecord

hasTranslation() public méthode

Returns a value indicating whether the translation model for the specified language exists.
public hasTranslation ( string | null $language = null ) : boolean
$language string | null
Résultat boolean

init() public méthode

public init ( )

translate() public méthode

Returns the translation model for the specified language.
public translate ( string | null $language = null ) : ActiveRecord
$language string | null
Résultat yii\db\ActiveRecord

Property Details

$translationAttributes public_oe property

the list of attributes to be translated
public $translationAttributes

$translationLanguageAttribute public_oe property

the translations model language attribute name
public $translationLanguageAttribute

$translationRelation public_oe property

the translations relation name
public $translationRelation