PHP 클래스 RainLab\Translate\Models\Message

상속: extends Mode\Model
파일 보기 프로젝트 열기: rainlab/translate-plugin 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$cache
$hasNew
$locale
$table The database table used by the model.
$timestamps Indicates if the model should be timestamped.
$url

보호된 프로퍼티들

프로퍼티 타입 설명
$guarded Guarded fields
$jsonable List of attribute names which are json encoded and decoded from the database.

공개 메소드들

메소드 설명
forLocale ( string $locale = null, $default = null ) : string Gets a message for a given locale, or the default.
get ( string $messageId ) : string Creates or finds an untranslated message string.
getContentAttribute ( ) : string Returns the value for the active locale.
importMessageCodes ( array $messages, string $locale = null ) : void Import an array of messages. Only known messages are imported.
importMessages ( array $messages, string $locale = null ) : void Import an array of messages. Only known messages are imported.
saveToCache ( ) : void Save context messages to cache.
setContext ( string $locale, string $url = null ) Set the caching context, the page url.
toLocale ( string $locale = null, string $message ) : void Writes a translated message to a locale.
trans ( string $messageId, array $params = [] ) : string Looks up and translates a message by its string.

보호된 메소드들

메소드 설명
makeCacheKey ( ) : string Creates a cache key for storing context messages.
makeMessageCode ( string $messageId ) : string Creates a sterile key for a message.

메소드 상세

forLocale() 공개 메소드

Gets a message for a given locale, or the default.
public forLocale ( string $locale = null, $default = null ) : string
$locale string
리턴 string

get() 공개 정적인 메소드

Creates or finds an untranslated message string.
public static get ( string $messageId ) : string
$messageId string
리턴 string

getContentAttribute() 공개 메소드

Returns the value for the active locale.
public getContentAttribute ( ) : string
리턴 string

importMessageCodes() 공개 정적인 메소드

Import an array of messages. Only known messages are imported.
public static importMessageCodes ( array $messages, string $locale = null ) : void
$messages array
$locale string
리턴 void

importMessages() 공개 정적인 메소드

Import an array of messages. Only known messages are imported.
public static importMessages ( array $messages, string $locale = null ) : void
$messages array
$locale string
리턴 void

makeCacheKey() 보호된 정적인 메소드

Creates a cache key for storing context messages.
protected static makeCacheKey ( ) : string
리턴 string

makeMessageCode() 보호된 정적인 메소드

Creates a sterile key for a message.
protected static makeMessageCode ( string $messageId ) : string
$messageId string
리턴 string

saveToCache() 공개 정적인 메소드

Save context messages to cache.
public static saveToCache ( ) : void
리턴 void

setContext() 공개 정적인 메소드

Set the caching context, the page url.
public static setContext ( string $locale, string $url = null )
$locale string
$url string

toLocale() 공개 메소드

Writes a translated message to a locale.
public toLocale ( string $locale = null, string $message ) : void
$locale string
$message string
리턴 void

trans() 공개 정적인 메소드

Looks up and translates a message by its string.
public static trans ( string $messageId, array $params = [] ) : string
$messageId string
$params array
리턴 string

프로퍼티 상세

$cache 공개적으로 정적으로 프로퍼티

public static $cache

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

Guarded fields
protected $guarded

$hasNew 공개적으로 정적으로 프로퍼티

public static $hasNew

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

List of attribute names which are json encoded and decoded from the database.
protected $jsonable

$locale 공개적으로 정적으로 프로퍼티

public static $locale

$table 공개적으로 프로퍼티

The database table used by the model.
public $table

$timestamps 공개적으로 프로퍼티

Indicates if the model should be timestamped.
public $timestamps

$url 공개적으로 정적으로 프로퍼티

public static $url