Documentation

CallableObject extends AbstractCallable
in package

Pop utils callable object 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.2.0

Table of Contents

CLOSURE  = 'CLOSURE'
CLOSURE_PARAMS  = 'CLOSURE_PARAMS'
CONSTRUCTOR_CALL  = 'CONSTRUCTOR_CALL'
CONSTRUCTOR_CALL_PARAMS  = 'CONSTRUCTOR_CALL_PARAMS'
FUNCTION  = 'FUNCTION'
Call type constants
FUNCTION_PARAMS  = 'FUNCTION_PARAMS'
INSTANCE_CALL  = 'INSTANCE_CALL'
INSTANCE_CALL_PARAMS  = 'INSTANCE_CALL_PARAMS'
IS_CALLABLE  = 'IS_CALLABLE'
IS_CALLABLE_PARAMS  = 'IS_CALLABLE_PARAMS'
NEW_OBJECT  = 'NEW_OBJECT'
OBJECT  = 'OBJECT'
STATIC_CALL  = 'STATIC_CALL'
STATIC_CALL_PARAMS  = 'STATIC_CALL_PARAMS'
$callable  : mixed
Callable
$callableType  : string
Callable type
$class  : string
Callable class
$constructorParams  : array<string|int, mixed>
Constructor parameters for instance calls
$method  : string
Callable method
$parameters  : array<string|int, mixed>
Parameters
$wasCalled  : bool
Was called flag
__construct()  : mixed
Constructor
addNamedParameter()  : AbstractCallable
Add a parameter
addParameter()  : AbstractCallable
Add a parameter
addParameters()  : AbstractCallable
Add parameters
call()  : mixed
Execute the callable
getCallable()  : mixed
Get callable
getCallableType()  : string
Get callable type
getConstructorParam()  : mixed
Get a constructor parameter for instance call
getConstructorParams()  : array<string|int, mixed>
Get constructor parameters for instance call
getParameter()  : mixed
Get a parameter
getParameters()  : array<string|int, mixed>
Get parameters
hasConstructorParam()  : bool
Has a constructor parameter for instance call
hasConstructorParams()  : bool
Has constructor parameters for instance call
hasParameter()  : bool
Has a parameter
hasParameters()  : bool
Has parameters
isCallable()  : bool
Check if object is callable
prepare()  : CallableObject
Prepare object for call
prepareParameters()  : CallableObject
Prepare parameters
removeConstructorParam()  : AbstractCallable
Remove a constructor parameter for instance call
removeConstructorParams()  : AbstractCallable
Remove all constructor parameters for instance call
removeParameter()  : AbstractCallable
Remove a parameter
removeParameters()  : AbstractCallable
Remove all parameters
setCallable()  : AbstractCallable
Set callable
setConstructorParams()  : AbstractCallable
Set constructor parameters
setParameters()  : AbstractCallable
Set parameters
wasCalled()  : bool
Check if object was called

Constants

CONSTRUCTOR_CALL_PARAMS

public mixed CONSTRUCTOR_CALL_PARAMS = 'CONSTRUCTOR_CALL_PARAMS'

INSTANCE_CALL_PARAMS

public mixed INSTANCE_CALL_PARAMS = 'INSTANCE_CALL_PARAMS'

IS_CALLABLE_PARAMS

public mixed IS_CALLABLE_PARAMS = 'IS_CALLABLE_PARAMS'

STATIC_CALL_PARAMS

public mixed STATIC_CALL_PARAMS = 'STATIC_CALL_PARAMS'

Properties

$constructorParams

Constructor parameters for instance calls

protected array<string|int, mixed> $constructorParams = []

$parameters

Parameters

protected array<string|int, mixed> $parameters = []

Methods

__construct()

Constructor

public __construct(mixed $callable[, mixed $parameters = null ]) : mixed

Instantiate the callable object

Parameters
$callable : mixed
$parameters : mixed = null
Return values
mixed

call()

Execute the callable

public call([mixed $parameters = null ]) : mixed
Parameters
$parameters : mixed = null
Return values
mixed

getCallable()

Get callable

public getCallable() : mixed
Return values
mixed

getCallableType()

Get callable type

public getCallableType() : string
Return values
string

getConstructorParam()

Get a constructor parameter for instance call

public getConstructorParam(string $key) : mixed
Parameters
$key : string
Return values
mixed

getConstructorParams()

Get constructor parameters for instance call

public getConstructorParams() : array<string|int, mixed>
Return values
array<string|int, mixed>

getParameter()

Get a parameter

public getParameter(string $key) : mixed
Parameters
$key : string
Return values
mixed

getParameters()

Get parameters

public getParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>

hasConstructorParam()

Has a constructor parameter for instance call

public hasConstructorParam(string $key) : bool
Parameters
$key : string
Return values
bool

hasConstructorParams()

Has constructor parameters for instance call

public hasConstructorParams() : bool
Return values
bool

hasParameter()

Has a parameter

public hasParameter(string $key) : bool
Parameters
$key : string
Return values
bool

hasParameters()

Has parameters

public hasParameters() : bool
Return values
bool

isCallable()

Check if object is callable

public isCallable() : bool
Return values
bool

setConstructorParams()

Set constructor parameters

public setConstructorParams(array<string|int, mixed> $constructorParams) : AbstractCallable
Parameters
$constructorParams : array<string|int, mixed>
Return values
AbstractCallable

wasCalled()

Check if object was called

public wasCalled() : bool
Return values
bool

Search results