PHP 트레잇 Mpociot\Versionable\VersionableTrait

파일 보기 프로젝트 열기: mpociot/versionable

보호된 프로퍼티들

프로퍼티 타입 설명
$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