Documentation

AbstractAdapter
in package
implements AdapterInterface

Auditor abstract adapter

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
1.3.0

Interfaces, Classes and Traits

AdapterInterface
Auditor adapter interface

Table of Contents

CREATED  = 'created'
Constants for action states
DELETED  = 'deleted'
UPDATED  = 'updated'
$action  : string
Action (created, updated, deleted)
$domain  : string
Domain
$metadata  : array<string|int, mixed>
Metadata
$method  : string
Method
$model  : string
Model name
$modelId  : int
Model ID
$modified  : array<string|int, mixed>
Modified model state differences
$original  : array<string|int, mixed>
Original model state differences
$route  : string
Route
$userId  : int
User ID
$username  : string
Username
addMetadata()  : self
Add to the metadata
getAction()  : string
Get the action
getDomain()  : string
Get the domain
getMetadata()  : mixed
Get the metadata
getMethod()  : string
Get the method
getModel()  : string
Get the model name
getModelId()  : int
Get the model ID
getModified()  : array<string|int, mixed>
Get the modified model state differences
getOriginal()  : array<string|int, mixed>
Get the original model state differences
getRoute()  : string
Get the route
getSnapshot()  : array<string|int, mixed>
Get model snapshot by ID
getStateByDate()  : array<string|int, mixed>
Get model state by date
getStateById()  : array<string|int, mixed>
Get model state by ID
getStateByModel()  : array<string|int, mixed>
Get model state by model
getStateByTimestamp()  : array<string|int, mixed>
Get model state by timestamp
getStates()  : array<string|int, mixed>
Get model states
getUserId()  : int
Get the user ID
getUsername()  : string
Get the username
hasDiff()  : bool
Check if the model states are different
hasMetadata()  : bool
Determine if there is metadata
prepareData()  : array<string|int, mixed>
Prepare data
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()  : self
Set the domain
setMetadata()  : self
Set the metadata
setMethod()  : self
Set the method
setModel()  : self
Set the model name
setModelId()  : self
Set the model ID
setRoute()  : self
Set the route
setUserId()  : self
Set the user ID
setUsername()  : self
Set the username

Constants

Properties

$action

Action (created, updated, deleted)

protected string $action = null

$metadata

Metadata

protected array<string|int, mixed> $metadata = []

$modified

Modified model state differences

protected array<string|int, mixed> $modified = []

$original

Original model state differences

protected array<string|int, mixed> $original = []

Methods

addMetadata()

Add to the metadata

public addMetadata(string $name, mixed $value) : self
Parameters
$name : string
$value : mixed
Return values
self

getAction()

Get the action

public getAction() : string
Return values
string

getDomain()

Get the domain

public getDomain() : string
Return values
string

getMetadata()

Get the metadata

public getMetadata([string $name = null ]) : mixed
Parameters
$name : string = null
Return values
mixed

getMethod()

Get the method

public getMethod() : string
Return values
string

getModel()

Get the model name

public getModel() : string
Return values
string

getModelId()

Get the model ID

public getModelId() : int
Return values
int

getModified()

Get the modified model state differences

public getModified() : array<string|int, mixed>
Return values
array<string|int, mixed>

getOriginal()

Get the original model state differences

public getOriginal() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRoute()

Get the route

public getRoute() : string
Return values
string

getSnapshot()

Get model snapshot by ID

public abstract getSnapshot(int $id[, bool $post = false ]) : array<string|int, mixed>
Parameters
$id : int
$post : bool = false
Return values
array<string|int, mixed>

getStateByDate()

Get model state by date

public abstract getStateByDate(string $from[, string $backTo = null ]) : array<string|int, mixed>
Parameters
$from : string
$backTo : string = null
Return values
array<string|int, mixed>

getStateById()

Get model state by ID

public abstract getStateById(int $id) : array<string|int, mixed>
Parameters
$id : int
Return values
array<string|int, mixed>

getStateByModel()

Get model state by model

public abstract getStateByModel(string $model[, int $modelId = null ]) : array<string|int, mixed>
Parameters
$model : string
$modelId : int = null
Return values
array<string|int, mixed>

getStateByTimestamp()

Get model state by timestamp

public abstract getStateByTimestamp(string $from[, string $backTo = null ]) : array<string|int, mixed>
Parameters
$from : string
$backTo : string = null
Return values
array<string|int, mixed>

getStates()

Get model states

public abstract getStates() : array<string|int, mixed>
Return values
array<string|int, mixed>

getUserId()

Get the user ID

public getUserId() : int
Return values
int

getUsername()

Get the username

public getUsername() : string
Return values
string

hasDiff()

Check if the model states are different

public hasDiff() : bool
Return values
bool

hasMetadata()

Determine if there is metadata

public hasMetadata([string $name = null ]) : bool
Parameters
$name : string = null
Return values
bool

prepareData()

Prepare data

public prepareData([bool $jsonEncode = true ]) : array<string|int, mixed>
Parameters
$jsonEncode : bool = true
Return values
array<string|int, mixed>

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 abstract send() : mixed
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 the domain

public setDomain(string $domain) : self
Parameters
$domain : string
Return values
self

setMetadata()

Set the metadata

public setMetadata(array<string|int, mixed> $metadata) : self
Parameters
$metadata : array<string|int, mixed>
Return values
self

setMethod()

Set the method

public setMethod(string $method) : self
Parameters
$method : string
Return values
self

setModel()

Set the model name

public setModel(string $model) : self
Parameters
$model : string
Return values
self

setModelId()

Set the model ID

public setModelId(int $modelId) : self
Parameters
$modelId : int
Return values
self

setRoute()

Set the route

public setRoute(string $route) : self
Parameters
$route : string
Return values
self

setUserId()

Set the user ID

public setUserId(int $userId) : self
Parameters
$userId : int
Return values
self

setUsername()

Set the username

public setUsername(string $username) : self
Parameters
$username : string
Return values
self

Search results