PHP Class ManaPHP\Counter

Inheritance: extends Component, implements manaphp\CounterInterface
Show file Open project: manaphp/manaphp

Public Properties

Property Type Description
$adapter ManaPHP\Counter\AdapterInterface

Protected Properties

Property Type Description
$_prefix string

Public Methods

Method Description
__construct ( string | array | ManaPHP\Counter\AdapterInterface $options = [] ) Counter constructor.
decrement ( string $type, string $id, integer $step = 1 ) : integer Decrements the value of key by a given step.
delete ( string $type, string $id ) : void Deletes the key
get ( string $type, string $id ) : integer
increment ( string $type, string $id, integer $step = 1 ) : integer Increments the value of key by a given step.
setDependencyInjector ( ManaPHP\DiInterface $dependencyInjector ) : static

Method Details

__construct() public method

Counter constructor.
public __construct ( string | array | ManaPHP\Counter\AdapterInterface $options = [] )
$options string | array | ManaPHP\Counter\AdapterInterface

decrement() public method

Decrements the value of key by a given step.
public decrement ( string $type, string $id, integer $step = 1 ) : integer
$type string
$id string
$step integer
return integer the new value

delete() public method

Deletes the key
public delete ( string $type, string $id ) : void
$type string
$id string
return void

get() public method

public get ( string $type, string $id ) : integer
$type string
$id string
return integer

increment() public method

Increments the value of key by a given step.
public increment ( string $type, string $id, integer $step = 1 ) : integer
$type string
$id string
$step integer
return integer the new value

setDependencyInjector() public method

public setDependencyInjector ( ManaPHP\DiInterface $dependencyInjector ) : static
$dependencyInjector ManaPHP\DiInterface
return static

Property Details

$_prefix protected property

protected string $_prefix
return string

$adapter public property

public AdapterInterface,ManaPHP\Counter $adapter
return ManaPHP\Counter\AdapterInterface