class ProgrammableCallback implements ConfigProvider

Properties

protected callable $callback
protected string $js
protected array $params
protected array $vars

Methods

__construct(callable $callback)

No description

addParameterByValue(mixed $paramValue)

Add a parameter by value

addParameterByName(string $paramName)

Add a parameter by name

callable
getCallback()

Get this object's callback

string
getJS()

Get this callback's JavaScript

array
getVars()

Get this object's variables

resetParameters()

Remove all the parameters

setJS(string $js)

Set this callback's JavaScript

setVar(string $name, string $value)

Set or overwrite one of this callback's variable

setVars(array $vars)

Set all of this callback's variables at once

array|Dictionary|null
asConfig()

Return an array-based representation of this object to be used for parsing

void
autoloadJS()

Try to load the JavaScript source for this callback

callable
normalizeCallback(callable $callback)

Normalize a callback's representation

Details

at line 41
__construct(callable $callback)

No description

Parameters

callable $callback

at line 58
ProgrammableCallback addParameterByValue(mixed $paramValue)

Add a parameter by value

Parameters

mixed $paramValue

Return Value

ProgrammableCallback

at line 73
ProgrammableCallback addParameterByName(string $paramName)

Add a parameter by name

The value will be dynamically generated by the caller

Parameters

string $paramName

Return Value

ProgrammableCallback

at line 90
callable getCallback()

Get this object's callback

Return Value

callable

at line 100
string getJS()

Get this callback's JavaScript

Return Value

string

at line 110
array getVars()

Get this object's variables

Return Value

array

at line 120
ProgrammableCallback resetParameters()

Remove all the parameters

Return Value

ProgrammableCallback

at line 133
ProgrammableCallback setJS(string $js)

Set this callback's JavaScript

Parameters

string $js

JavaScript source code for this callback

Return Value

ProgrammableCallback

at line 147
ProgrammableCallback setVar(string $name, string $value)

Set or overwrite one of this callback's variable

Parameters

string $name

Variable name

string $value

Variable value

Return Value

ProgrammableCallback

at line 160
ProgrammableCallback setVars(array $vars)

Set all of this callback's variables at once

Parameters

array $vars

Associative array of values

Return Value

ProgrammableCallback

at line 170
array|Dictionary|null asConfig()

Return an array-based representation of this object to be used for parsing

NOTE: if this method was named getConfig() it could interfere with magic getters from the Configurable trait

Return Value

array|Dictionary|null

at line 209
protected void autoloadJS()

Try to load the JavaScript source for this callback

Return Value

void

at line 232
protected callable normalizeCallback(callable $callback)

Normalize a callback's representation

Parameters

callable $callback

Return Value

callable