Spork Code Libraries

Limit

Defines a type of event to keep track of, the maximum times the event is allowed to occur in an interval and the actions to take when the threshold is exceeded.

Properties

$name

$name : string

Event name

Type

string

$limit

$limit : integer

Maximum number of times and event is allowed to occur

Type

integer

$actions

$actions : array

List of ActionInterface objects to invoke when limit is exceeded

Type

array

Methods

__construct()

__construct(string  $name, integer  $limit = null, \Spork\DateTime\DateInterval|string  $interval = null, array  $actions = null) 

Initialize instance

Parameters

string $name
integer $limit
\Spork\DateTime\DateInterval|string $interval
array $actions

getName()

getName() : string

Get limit name

Returns

string

getLimit()

getLimit() : integer

Get maximum count for this limit

Returns

integer

setLimit()

setLimit(integer  $limit) : \Spork\Mvc\Listener\Limit\Limit

Set the maximum count for this limit

Parameters

integer $limit

Returns

\Spork\Mvc\Listener\Limit\Limit

getActions()

getActions() : array

Get actions

Returns

array —

List of Action objects

setActions()

setActions(array  $actions) 

Set actions

Parameters

array $actions

List of Action object