PHP Трейт Mpociot\Versionable\VersionableTrait

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

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

Свойство Тип Описание
$versioningEnabled boolean Flag that determines if the model allows versioning at all

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

Метод Описание
bootVersionableTrait ( ) Initialize model events
currentVersion ( ) : Version Returns the latest version available
disableVersioning ( )
enableVersioning ( )
getVersionModel ( $version_id ) Get a model based on the version id
previousVersion ( ) : Version Returns the previous version
setReasonAttribute ( string $value ) Attribute mutator for "reason" Prevent "reason" to become a database attribute of model
versions ( ) : Illuminate\Database\Eloquent\Relations\MorphMany Return all versions of the model

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

Метод Описание
getAuthUserId ( ) : integer | null
versionablePostSave ( ) : void Save a new version.
versionablePreSave ( ) : void Pre save hook to determine if versioning is enabled and if we're updating the model

Приватные методы

Метод Описание
isValidForVersioning ( ) : boolean Determine if a new version should be created for this model.

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

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

Initialize model events
public static bootVersionableTrait ( )

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

Returns the latest version available
public currentVersion ( ) : Version
Результат Version

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

public disableVersioning ( )

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

public enableVersioning ( )

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

protected getAuthUserId ( ) : integer | null
Результат integer | null

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

Get a model based on the version id
public getVersionModel ( $version_id )
$version_id

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

Returns the previous version
public previousVersion ( ) : Version
Результат Version

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

Attribute mutator for "reason" Prevent "reason" to become a database attribute of model
public setReasonAttribute ( string $value )
$value string

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

Save a new version.
protected versionablePostSave ( ) : void
Результат void

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

Pre save hook to determine if versioning is enabled and if we're updating the model
protected versionablePreSave ( ) : void
Результат void

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

Return all versions of the model
public versions ( ) : Illuminate\Database\Eloquent\Relations\MorphMany
Результат Illuminate\Database\Eloquent\Relations\MorphMany

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

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

Flag that determines if the model allows versioning at all
protected bool $versioningEnabled
Результат boolean