PHP 클래스 bedezign\yii2\audit\AuditTrailBehavior

상속: extends yii\base\Behavior
파일 보기 프로젝트 열기: bedezign/yii2-audit 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$active boolean Is the behavior is active or not
$allowed array Array with fields to save You don't need to configure both allowed and ignored
$dateFormat string Date format to use in stamp - set to "Y-m-d H:i:s" for datetime or "U" for timestamp
$ignored array Array with fields to ignore You don't need to configure both allowed and ignored
$ignoredClasses array Array with classes to ignore
$override array Array with fields you want to override before saving the row into audit_trail table

공개 메소드들

메소드 설명
afterDelete ( )
afterFind ( )
afterInsert ( )
afterUpdate ( )
audit ( $action )
events ( )
getOldAttributes ( ) : array
setOldAttributes ( $value )

보호된 메소드들

메소드 설명
auditAttributes ( string $action )
cleanAttributes ( $attributes ) : mixed Clean attributes of fields that are not allowed or ignored.
cleanAttributesAllowed ( $attributes ) : mixed Unset attributes which are not allowed
cleanAttributesIgnored ( $attributes ) : mixed Unset attributes which are ignored
cleanAttributesOverride ( $attributes ) : mixed attributes which need to get override with a new value
getAuditEntryId ( ) : AuditEntry | null | static
getNormalizedPk ( ) : string
getUserId ( ) : integer | null | string
saveAuditTrail ( $action, $newAttributes, $oldAttributes, $entry_id, $user_id, $model, $model_id, $created ) Save the audit trails for a create or update action
saveAuditTrailDelete ( ) Save the audit trails for a delete action

비공개 메소드들

메소드 설명
getNewOverrideValues ( string $searchFieldValue, string $queryParams ) : mixed

메소드 상세

afterDelete() 공개 메소드

public afterDelete ( )

afterFind() 공개 메소드

public afterFind ( )

afterInsert() 공개 메소드

public afterInsert ( )

afterUpdate() 공개 메소드

public afterUpdate ( )

audit() 공개 메소드

public audit ( $action )
$action

auditAttributes() 보호된 메소드

protected auditAttributes ( string $action )
$action string

cleanAttributes() 보호된 메소드

Clean attributes of fields that are not allowed or ignored.
protected cleanAttributes ( $attributes ) : mixed
$attributes
리턴 mixed

cleanAttributesAllowed() 보호된 메소드

Unset attributes which are not allowed
protected cleanAttributesAllowed ( $attributes ) : mixed
$attributes
리턴 mixed

cleanAttributesIgnored() 보호된 메소드

Unset attributes which are ignored
protected cleanAttributesIgnored ( $attributes ) : mixed
$attributes
리턴 mixed

cleanAttributesOverride() 보호된 메소드

attributes which need to get override with a new value
protected cleanAttributesOverride ( $attributes ) : mixed
$attributes
리턴 mixed

events() 공개 메소드

public events ( )

getAuditEntryId() 보호된 메소드

protected getAuditEntryId ( ) : AuditEntry | null | static
리턴 bedezign\yii2\audit\models\AuditEntry | null | static

getNormalizedPk() 보호된 메소드

protected getNormalizedPk ( ) : string
리턴 string

getOldAttributes() 공개 메소드

public getOldAttributes ( ) : array
리턴 array

getUserId() 보호된 메소드

protected getUserId ( ) : integer | null | string
리턴 integer | null | string

saveAuditTrail() 보호된 메소드

Save the audit trails for a create or update action
protected saveAuditTrail ( $action, $newAttributes, $oldAttributes, $entry_id, $user_id, $model, $model_id, $created )
$action
$newAttributes
$oldAttributes
$entry_id
$user_id
$model
$model_id
$created

saveAuditTrailDelete() 보호된 메소드

Save the audit trails for a delete action
protected saveAuditTrailDelete ( )

setOldAttributes() 공개 메소드

public setOldAttributes ( $value )
$value

프로퍼티 상세

$active 공개적으로 프로퍼티

Is the behavior is active or not
public bool $active
리턴 boolean

$allowed 공개적으로 프로퍼티

Array with fields to save You don't need to configure both allowed and ignored
public array $allowed
리턴 array

$dateFormat 공개적으로 프로퍼티

Date format to use in stamp - set to "Y-m-d H:i:s" for datetime or "U" for timestamp
public string $dateFormat
리턴 string

$ignored 공개적으로 프로퍼티

Array with fields to ignore You don't need to configure both allowed and ignored
public array $ignored
리턴 array

$ignoredClasses 공개적으로 프로퍼티

Array with classes to ignore
public array $ignoredClasses
리턴 array

$override 공개적으로 프로퍼티

Array with fields you want to override before saving the row into audit_trail table
public array $override
리턴 array