Auditor
in package
Auditor class
Tags
Table of Contents
- $adapter : AdapterInterface
- Auditor adapter
- __construct() : mixed
- Constructor
- adapter() : mixed
- Get the adapter
- addMetadata() : Auditor
- Add to the metadata
- hasDiff() : bool
- Check if the model states are different
- resolveDiff() : self
- Resolve the differences in values between the model states
- send() : mixed
- Send the results of the audit
- setDiff() : self
- 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
- setUser() : Auditor
- Set user
Properties
$adapter
Auditor adapter
protected
AdapterInterface
$adapter
= null
Methods
__construct()
Constructor
public
__construct(AdapterInterface $adapter) : mixed
Instantiate the auditor object
Parameters
- $adapter : AdapterInterface
Return values
mixed —adapter()
Get the adapter
public
adapter() : mixed
Return values
mixed —addMetadata()
Add to the metadata
public
addMetadata(string $name, mixed $value) : Auditor
Parameters
- $name : string
- $value : mixed
Return values
Auditor —hasDiff()
Check if the model states are different
public
hasDiff() : bool
Return values
bool —resolveDiff()
Resolve the differences in values between the model states
public
resolveDiff([array<string|int, mixed> $old = [] ][, array<string|int, mixed> $new = [] ]) : self
Parameters
- $old : array<string|int, mixed> = []
- $new : array<string|int, mixed> = []
Return values
self —send()
Send the results of the audit
public
send([array<string|int, mixed> $old = null ][, array<string|int, mixed> $new = null ]) : mixed
Parameters
- $old : array<string|int, mixed> = null
- $new : array<string|int, mixed> = null
Return values
mixed —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 = [] ]) : self
Parameters
- $old : array<string|int, mixed> = []
- $new : array<string|int, mixed> = []
Return values
self —setDomain()
Set domain, route and method
public
setDomain([string $domain = null ][, string $route = null ][, string $method = null ]) : Auditor
Parameters
- $domain : string = null
- $route : string = null
- $method : string = null
Return values
Auditor —setMetadata()
Set the metadata
public
setMetadata(array<string|int, mixed> $metadata) : Auditor
Parameters
- $metadata : array<string|int, mixed>
Return values
Auditor —setModel()
Set user
public
setModel([string $model = null ][, int $modelId = null ]) : Auditor
Parameters
- $model : string = null
- $modelId : int = null
Return values
Auditor —setUser()
Set user
public
setUser([string $username = null ][, int $userId = null ]) : Auditor
Parameters
- $username : string = null
- $userId : int = null