PHP Класс Flarum\Database\AbstractModel

Adds the ability for custom relations to be added to a model during runtime. These relations behave in the same way that you would expect; they can be queried, eager loaded, and accessed as an attribute.
Наследование: extends Illuminate\Database\Eloquent\Model
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$timestamps boolean Indicates if the model should be timestamped. Turn off by default.

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

Свойство Тип Описание
$afterDeleteCallbacks callable[] An array of callbacks to be run once after the model is deleted.
$afterSaveCallbacks callable[] An array of callbacks to be run once after the model is saved.

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

Метод Описание
__call ( $method, $arguments )
__construct ( array $attributes = [] )
afterDelete ( callable $callback ) : void Register a callback to be run once after the model is deleted.
afterSave ( callable $callback ) : void Register a callback to be run once after the model is saved.
boot ( )
getAttribute ( string $key ) : mixed Get an attribute from the model. If nothing is found, attempt to load a custom relation method with this key.
getDates ( ) : array Get the attributes that should be converted to dates.
releaseAfterDeleteCallbacks ( ) : callable[]
releaseAfterSaveCallbacks ( ) : callable[]

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

Метод Описание
getCustomRelation ( string $name ) : mixed Get a custom relation object.

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

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

public __call ( $method, $arguments )

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

public __construct ( array $attributes = [] )
$attributes array

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

Register a callback to be run once after the model is deleted.
public afterDelete ( callable $callback ) : void
$callback callable
Результат void

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

Register a callback to be run once after the model is saved.
public afterSave ( callable $callback ) : void
$callback callable
Результат void

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

public static boot ( )

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

Get an attribute from the model. If nothing is found, attempt to load a custom relation method with this key.
public getAttribute ( string $key ) : mixed
$key string
Результат mixed

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

Get a custom relation object.
protected getCustomRelation ( string $name ) : mixed
$name string
Результат mixed

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

Get the attributes that should be converted to dates.
public getDates ( ) : array
Результат array

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

public releaseAfterDeleteCallbacks ( ) : callable[]
Результат callable[]

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

public releaseAfterSaveCallbacks ( ) : callable[]
Результат callable[]

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

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

An array of callbacks to be run once after the model is deleted.
protected callable[] $afterDeleteCallbacks
Результат callable[]

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

An array of callbacks to be run once after the model is saved.
protected callable[] $afterSaveCallbacks
Результат callable[]

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

Indicates if the model should be timestamped. Turn off by default.
public bool $timestamps
Результат boolean