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-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
2.1.0

Table of Contents

Constants

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'

Properties

$callable  : mixed
Callable
$callableType  : string|null
Callable type
$class  : string|null
Callable class
$constructorParams  : array<string|int, mixed>
Constructor parameters for instance calls
$method  : string|null
Callable method
$parameters  : array<string|int, mixed>
Parameters
$wasCalled  : bool
Was called flag

Methods

__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|null
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

call()

Execute the callable

public call([mixed $parameters = null ]) : mixed
Parameters
$parameters : mixed = null
Tags
throws
Exception|ReflectionException

getCallableType()

Get callable type

public getCallableType() : string|null
Return values
string|null

getConstructorParam()

Get a constructor parameter for instance call

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

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

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

wasCalled()

Check if object was called

public wasCalled() : bool
Return values
bool

        
On this page

Search results