Documentation

Http extends AbstractAdapter
in package

Auditor HTTP class

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

Table of Contents

CREATED  = 'created'
Constants for action states
DELETED  = 'deleted'
UPDATED  = 'updated'
$action  : string
Action (created, updated, deleted)
$domain  : string
Domain
$fetchStream  : Stream
Stream to fetch the audit results
$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
$sendStream  : Stream
Stream to send the audit results
$userId  : int
User ID
$username  : string
Username
__construct()  : mixed
Constructor
addMetadata()  : self
Add to the metadata
getAction()  : string
Get the action
getDomain()  : string
Get the domain
getFetchedResult()  : mixed
Get the fetched result
getFetchStream()  : Stream
Get the fetch stream
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
getSendStream()  : Stream
Get the send stream
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
hasFetchStream()  : bool
Determine if the adapter has a fetch stream
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()  : Stream
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
setFetchStream()  : Http
Set the fetch stream
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
setSendStream()  : Http
Set the send stream
setUserId()  : self
Set the user ID
setUsername()  : self
Set the username

Constants

Properties

$action

Action (created, updated, deleted)

protected string $action = null

$fetchStream

Stream to fetch the audit results

protected Stream $fetchStream = 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 = []

$sendStream

Stream to send the audit results

protected Stream $sendStream = null

Methods

__construct()

Constructor

public __construct(Stream $sendStream[, Stream $fetchStream = null ]) : mixed

Instantiate the HTTP adapter object

Parameters
$sendStream : Stream
$fetchStream : Stream = null
Return values
mixed

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

getFetchedResult()

Get the fetched result

public getFetchedResult() : mixed
Return values
mixed

getFetchStream()

Get the fetch stream

public getFetchStream() : Stream
Return values
Stream

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

getSendStream()

Get the send stream

public getSendStream() : Stream
Return values
Stream

getSnapshot()

Get model snapshot by ID

public 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 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 getStateById(int $id[, bool $asQuery = false ]) : array<string|int, mixed>
Parameters
$id : int
$asQuery : bool = false
Return values
array<string|int, mixed>

getStateByModel()

Get model state by model

public 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 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 getStates([array<string|int, mixed> $fields = [] ]) : array<string|int, mixed>
Parameters
$fields : 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

hasFetchStream()

Determine if the adapter has a fetch stream

public hasFetchStream() : 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

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

setFetchStream()

Set the fetch stream

public setFetchStream(Stream $fetchStream) : Http
Parameters
$fetchStream : Stream
Return values
Http

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

setSendStream()

Set the send stream

public setSendStream(Stream $sendStream) : Http
Parameters
$sendStream : Stream
Return values
Http

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