PHP Трейт Waavi\Translation\Traits\Translatable

Показать файл Открыть проект

Открытые методы

Метод Описание
attributesToArray ( ) : array Extend parent's attributesToArray so that _translation attributes do not appear in array, and translatable attributes are translated.
bootTranslatable ( ) : void Register Model observer.
getAttribute ( $attribute ) : mixed Hijack parent's getAttribute to get the translation of the given field instead of its value.
getRawAttribute ( $attribute )
isTranslatable ( $attribute ) : boolean Check if an attribute is translatable.
isTranslated ( string $attribute ) : boolean Check if a translation exists for the given attribute.
rawValueRequested ( string $attribute ) : boolean Check if the attribute being queried is the raw value of a translatable attribute.
setAttribute ( string $attribute, string $value ) : void Hijack Eloquent's setAttribute to create a Language Entry, or update the existing one, when setting the value of this attribute.
translatableAttributes ( ) : array Return the translatable attributes array
translate ( string $attribute ) : Translation Return the translation related to a translatable attribute.
translationCodeFor ( string $attribute ) : string Get the set translation code for the give attribute

Описание методов

attributesToArray() публичный Метод

@return array
public attributesToArray ( ) : array
Результат array

bootTranslatable() публичный статический Метод

@return void
public static bootTranslatable ( ) : void
Результат void

getAttribute() публичный Метод

@param string $key Attribute name
public getAttribute ( $attribute ) : mixed
Результат mixed

getRawAttribute() публичный Метод

public getRawAttribute ( $attribute )
$attribute

isTranslatable() публичный Метод

@return boolean
public isTranslatable ( $attribute ) : boolean
Результат boolean

isTranslated() публичный Метод

@param string $attribute
public isTranslated ( string $attribute ) : boolean
$attribute string
Результат boolean

rawValueRequested() публичный Метод

@param string $attribute
public rawValueRequested ( string $attribute ) : boolean
$attribute string
Результат boolean

setAttribute() публичный Метод

@param string $attribute Attribute name
public setAttribute ( string $attribute, string $value ) : void
$attribute string
$value string Text value in default locale. @return void
Результат void

translatableAttributes() публичный Метод

@return array
public translatableAttributes ( ) : array
Результат array

translate() публичный Метод

@param string $attribute
public translate ( string $attribute ) : Translation
$attribute string
Результат Translation

translationCodeFor() публичный Метод

@param string $attribute
public translationCodeFor ( string $attribute ) : string
$attribute string
Результат string