PHP 클래스 RainLab\Translate\Behaviors\TranslatableCmsObject

Usage: In the CMS object class definition: public $implement = ['@RainLab.Translate.Behaviors.TranslatableCmsObject']; public $translatable = ['title', 'markup']; This definition is optional and defaults to RainLab\Translate\Classes\MLCmsObject public $translatableModel = 'RainLab\Translate\Classes\MLStaticPage';
상속: extends RainLab\Translate\Classes\TranslatableBehavior
파일 보기 프로젝트 열기: rainlab/translate-plugin

보호된 프로퍼티들

프로퍼티 타입 설명
$translatableViewBag Data store for translated viewbag attributes.

공개 메소드들

메소드 설명
__construct ( October\Rain\Database\Model $model ) Constructor
getTranslatableModelClass ( ) : array Returns a collection of fields that will be hashed.
syncTranslatableAttributes ( ) {@inheritDoc}

보호된 메소드들

메소드 설명
createModel ( ) : Model Internal method, prepare the form model object
getCmsObjectForLocale ( $locale )
isEmptyDataSet ( array $data ) : boolean Returns true if all attributes are empty (false when converted to booleans).
loadTranslatableData ( string $locale = null ) : array Loads the translation data from the join table.
mergeViewBagAttributes ( ) : void Merge the viewBag array for the base and translated objects.
overrideTwigCacheKey ( $key ) : string | null Translated CMS objects need their own unique cache key in twig.
storeTranslatableData ( string $locale = null ) : void Saves the translation data in the join table.
syncTranslatableFileNames ( ) If the parent model file name is changed, this should be reflected in the translated models also.

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( October\Rain\Database\Model $model )
$model October\Rain\Database\Model The extended model.

createModel() 보호된 메소드

Internal method, prepare the form model object
protected createModel ( ) : Model
리턴 Model

getCmsObjectForLocale() 보호된 메소드

protected getCmsObjectForLocale ( $locale )

getTranslatableModelClass() 공개 메소드

Returns a collection of fields that will be hashed.
public getTranslatableModelClass ( ) : array
리턴 array

isEmptyDataSet() 보호된 메소드

Returns true if all attributes are empty (false when converted to booleans).
protected isEmptyDataSet ( array $data ) : boolean
$data array
리턴 boolean

loadTranslatableData() 보호된 메소드

Loads the translation data from the join table.
protected loadTranslatableData ( string $locale = null ) : array
$locale string
리턴 array

mergeViewBagAttributes() 보호된 메소드

Merge the viewBag array for the base and translated objects.
protected mergeViewBagAttributes ( ) : void
리턴 void

overrideTwigCacheKey() 보호된 메소드

Translated CMS objects need their own unique cache key in twig.
protected overrideTwigCacheKey ( $key ) : string | null
리턴 string | null

storeTranslatableData() 보호된 메소드

Saves the translation data in the join table.
protected storeTranslatableData ( string $locale = null ) : void
$locale string
리턴 void

syncTranslatableAttributes() 공개 메소드

{@inheritDoc}

syncTranslatableFileNames() 보호된 메소드

If the parent model file name is changed, this should be reflected in the translated models also.

프로퍼티 상세

$translatableViewBag 보호되어 있는 프로퍼티

Data store for translated viewbag attributes.
protected $translatableViewBag