PHP Класс Polyglot\Polyglot

Наследование: extends Illuminate\Database\Eloquent\Model
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$polyglot array The attributes to translate

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

Метод Описание
__call ( string $method, array $parameters ) : mixed Handle polyglot dynamic method calls for locale relations.
__get ( string $key ) : mixed Get a localized attribute
__isset ( string $key ) : boolean Checks if a field isset while taking into account localized attributes
getLangClass ( ) : string Get the Lang class corresponding to the current model
getPolyglotAttributes ( ) : array Get the polyglot attributes
lang ( string $lang = null ) : Illuminate\Database\Eloquent\Relations\HasOne Reroutes functions to the language in use
localize ( array $localization ) : boolean | null Localize a model with an array of lang arrays
scopeWithLang ( ) : Query Localize a "with" method
translations ( ) : Illuminate\Database\Eloquent\Relations\HasMany Get all translations

Защищенные методы

Метод Описание
boot ( ) The "booting" method of the model.
getAvailable ( ) : array Get an array of supported locales

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

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

Handle polyglot dynamic method calls for locale relations.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
Результат mixed

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

Get a localized attribute
public __get ( string $key ) : mixed
$key string The attribute
Результат mixed

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

Checks if a field isset while taking into account localized attributes
public __isset ( string $key ) : boolean
$key string The key
Результат boolean

boot() защищенный статический Метод

The "booting" method of the model.
protected static boot ( )

getAvailable() защищенный Метод

Get an array of supported locales
protected getAvailable ( ) : array
Результат array

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

Get the Lang class corresponding to the current model
public getLangClass ( ) : string
Результат string

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

Get the polyglot attributes
public getPolyglotAttributes ( ) : array
Результат array

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

Reroutes functions to the language in use
public lang ( string $lang = null ) : Illuminate\Database\Eloquent\Relations\HasOne
$lang string A language to use
Результат Illuminate\Database\Eloquent\Relations\HasOne

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

Localize a model with an array of lang arrays
public localize ( array $localization ) : boolean | null
$localization array An array in the form [field][lang][value]
Результат boolean | null

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

Localize a "with" method
public scopeWithLang ( ) : Query
Результат Query

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

Get all translations
public translations ( ) : Illuminate\Database\Eloquent\Relations\HasMany
Результат Illuminate\Database\Eloquent\Relations\HasMany

Описание свойств

$polyglot защищенное свойство

The attributes to translate
protected array $polyglot
Результат array