You are here

public function CounterInterface::setWriteCallback in Purge 8.3

Set the callback that gets called when writes occur.

The callback is called every time the counter changes value. The single only parameter passed to your callable is $value, you can use PHP's use statement to make any local variables available to it.

Parameters

callable $callback: Any PHP callable.

1 method overrides CounterInterface::setWriteCallback()
Counter::setWriteCallback in src/Counter/Counter.php
Set the callback that gets called when writes occur.

File

src/Counter/CounterInterface.php, line 81

Class

CounterInterface
Describes a numeric counter.

Namespace

Drupal\purge\Counter

Code

public function setWriteCallback(callable $callback);