PHP Класс RainLab\Translate\Models\Locale

Наследование: extends Mode\Model, use trait October\Rain\Database\Traits\Validation
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$rules Validation rules
$table The database table used by the model.
$timestamps

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

Свойство Тип Описание
$cacheByCode Object cache of self, by code.
$cacheListAvailable A cache of available locales.
$cacheListEnabled A cache of enabled locales.

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

Метод Описание
afterCreate ( )
beforeDelete ( )
beforeUpdate ( )
clearCache ( ) : void Clears all cache keys used by this model
findByCode ( string $code = null ) : Model Locate a locale table by its code, cached.
getDefault ( ) : self Returns the default locale defined.
isAvailable ( ) : boolean Returns true if there are at least 2 locales available.
isValid ( $locale ) : boolean Returns true if the supplied locale is valid.
listAvailable ( ) : array Lists available locales, used on the back-end.
listEnabled ( ) : array Lists the enabled locales, used on the front-end.
makeDefault ( ) : void Makes this model the default
scopeIsEnabled ( Builder $query ) : Builder Scope for checking if model is enabled

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

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

public afterCreate ( )

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

public beforeDelete ( )

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

public beforeUpdate ( )

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

Clears all cache keys used by this model
public static clearCache ( ) : void
Результат void

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

Locate a locale table by its code, cached.
public static findByCode ( string $code = null ) : Model
$code string
Результат Model

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

Returns the default locale defined.
public static getDefault ( ) : self
Результат self

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

Returns true if there are at least 2 locales available.
public static isAvailable ( ) : boolean
Результат boolean

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

Returns true if the supplied locale is valid.
public static isValid ( $locale ) : boolean
Результат boolean

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

Lists available locales, used on the back-end.
public static listAvailable ( ) : array
Результат array

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

Lists the enabled locales, used on the front-end.
public static listEnabled ( ) : array
Результат array

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

Makes this model the default
public makeDefault ( ) : void
Результат void

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

Scope for checking if model is enabled
public scopeIsEnabled ( Builder $query ) : Builder
$query Builder
Результат Builder

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

$cacheByCode защищенное статическое свойство

Object cache of self, by code.
protected static $cacheByCode

$cacheListAvailable защищенное статическое свойство

A cache of available locales.
protected static $cacheListAvailable

$cacheListEnabled защищенное статическое свойство

A cache of enabled locales.
protected static $cacheListEnabled

$rules публичное свойство

Validation rules
public $rules

$table публичное свойство

The database table used by the model.
public $table

$timestamps публичное свойство

public $timestamps