PHP 클래스 Venturecraft\Revisionable\Revision

Base model to allow for revision history on any model that extends this model (c) Venture Craft
상속: extends Illuminate\Database\Eloquent\Model
파일 보기 프로젝트 열기: venturecraft/revisionable 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$table string

보호된 프로퍼티들

프로퍼티 타입 설명
$revisionFormattedFields array

공개 메소드들

메소드 설명
__construct ( array $attributes = [] )
fieldName ( ) : string Field Name
format ( $key, $value ) : string Format the value according to the $revisionFormattedFields array.
historyOf ( ) : Object | false Returns the object we have the history of
newValue ( ) : string New Value.
oldValue ( ) : string Old Value.
revisionable ( ) : array Revisionable.
userResponsible ( ) : User User Responsible.

비공개 메소드들

메소드 설명
formatFieldName ( $key ) : boolean Format field name.
getRelatedModel ( ) : string Return the name of the related model.
getValue ( string $which = 'new' ) : string Responsible for actually doing the grunt work for getting the old or new value for the revision.
isRelated ( ) : boolean Return true if the key is for a related model.

메소드 상세

__construct() 공개 메소드

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

fieldName() 공개 메소드

Returns the field that was updated, in the case that it's a foreign key denoted by a suffix of "_id", then "_id" is simply stripped
public fieldName ( ) : string
리턴 string field

format() 공개 메소드

Format the value according to the $revisionFormattedFields array.
public format ( $key, $value ) : string
$key
$value
리턴 string formatted value

historyOf() 공개 메소드

Returns the object we have the history of
public historyOf ( ) : Object | false
리턴 Object | false

newValue() 공개 메소드

Grab the new value of the field, if it was a foreign key attempt to get an identifying name for the model.
public newValue ( ) : string
리턴 string old value

oldValue() 공개 메소드

Grab the old value of the field, if it was a foreign key attempt to get an identifying name for the model.
public oldValue ( ) : string
리턴 string old value

revisionable() 공개 메소드

Grab the revision history for the model that is calling
public revisionable ( ) : array
리턴 array revision history

userResponsible() 공개 메소드

User Responsible.
public userResponsible ( ) : User
리턴 User user responsible for the change

프로퍼티 상세

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

protected array $revisionFormattedFields
리턴 array

$table 공개적으로 프로퍼티

public string $table
리턴 string