Auditor
in package
Auditor class
Tags
Table of Contents
Properties
- $adapter : AdapterInterface|null
- Auditor adapter
Methods
- __construct() : mixed
- Constructor
- adapter() : AdapterInterface
- Get the adapter
- addMetadata() : Auditor
- Add to the metadata
- getStateData() : mixed
- Get state data
- hasDiff() : bool
- Check if the model states are different
- hasStateData() : bool
- Has state data
- resolveDiff() : Auditor
- Resolve the differences in values between the model states
- send() : mixed
- Send the results of the audit
- setDiff() : Auditor
- Set the differences in values between the model states (that have already been processed)
- setDomain() : Auditor
- Set domain, route and method
- setMetadata() : Auditor
- Set the metadata
- setModel() : Auditor
- Set user
- setStateData() : Auditor
- Set state data
- setUser() : Auditor
- Set user
Properties
$adapter
Auditor adapter
protected
AdapterInterface|null
$adapter
= null
Methods
__construct()
Constructor
public
__construct(AdapterInterface $adapter) : mixed
Instantiate the auditor object
Parameters
- $adapter : AdapterInterface
adapter()
Get the adapter
public
adapter() : AdapterInterface
Return values
AdapterInterfaceaddMetadata()
Add to the metadata
public
addMetadata(string $name, mixed $value) : Auditor
Parameters
- $name : string
- $value : mixed
Return values
AuditorgetStateData()
Get state data
public
getStateData([string|null $name = null ]) : mixed
Parameters
- $name : string|null = null
hasDiff()
Check if the model states are different
public
hasDiff() : bool
Return values
boolhasStateData()
Has state data
public
hasStateData([string|null $name = null ]) : bool
Parameters
- $name : string|null = null
Return values
boolresolveDiff()
Resolve the differences in values between the model states
public
resolveDiff([array<string|int, mixed> $old = [] ][, array<string|int, mixed> $new = [] ][, bool $state = true ]) : Auditor
Parameters
- $old : array<string|int, mixed> = []
- $new : array<string|int, mixed> = []
- $state : bool = true
Return values
Auditorsend()
Send the results of the audit
public
send([array<string|int, mixed>|null $old = null ][, array<string|int, mixed>|null $new = null ][, bool $state = true ]) : mixed
Parameters
- $old : array<string|int, mixed>|null = null
- $new : array<string|int, mixed>|null = null
- $state : bool = true
setDiff()
Set the differences in values between the model states (that have already been processed)
public
setDiff([array<string|int, mixed> $old = [] ][, array<string|int, mixed> $new = [] ]) : Auditor
Parameters
- $old : array<string|int, mixed> = []
- $new : array<string|int, mixed> = []
Return values
AuditorsetDomain()
Set domain, route and method
public
setDomain([string|null $domain = null ][, string|null $route = null ][, string|null $method = null ]) : Auditor
Parameters
- $domain : string|null = null
- $route : string|null = null
- $method : string|null = null
Return values
AuditorsetMetadata()
Set the metadata
public
setMetadata(array<string|int, mixed> $metadata) : Auditor
Parameters
- $metadata : array<string|int, mixed>
Return values
AuditorsetModel()
Set user
public
setModel([string|null $model = null ][, int|string|null $modelId = null ]) : Auditor
Parameters
- $model : string|null = null
- $modelId : int|string|null = null
Return values
AuditorsetStateData()
Set state data
public
setStateData(array<string|int, mixed> $stateData) : Auditor
Parameters
- $stateData : array<string|int, mixed>
Return values
AuditorsetUser()
Set user
public
setUser([string|null $username = null ][, int|null $userId = null ]) : Auditor
Parameters
- $username : string|null = null
- $userId : int|null = null