PHP Class creocoder\translateable\TranslateableBehavior

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

Public Properties

Property Type Description
$translationAttributes the list of attributes to be translated
$translationLanguageAttribute the translations model language attribute name
$translationRelation the translations relation name

Public Methods

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

public __get ( $name )

__set() public method

public __set ( $name, $value )

afterSave() public method

public afterSave ( ) : void
return void

afterValidate() public method

public afterValidate ( ) : void
return void

canGetProperty() public method

public canGetProperty ( $name, $checkVars = true )

canSetProperty() public method

public canSetProperty ( $name, $checkVars = true )

events() public method

public events ( )

getTranslation() public method

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

hasTranslation() public method

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

init() public method

public init ( )

translate() public method

Returns the translation model for the specified language.
public translate ( string | null $language = null ) : ActiveRecord
$language string | null
return 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