Jelix 1.8.8

jClassBinding
in package

Services binding for jelix.

Tags
subpackage

utils

experimental

This class is EXPERIMENTAL. Its API and its behaviors could change in future version

Table of Contents

$fromSelector  : jSelectorClass|jSelectorIface
$instance  : mixed
resulting binded instance.
$toSelector  : jSelectorClass
selector to the binded class (string form).
__construct()  : mixed
__constructor.
getClassName()  : string
Get the name of the binded class without creating this class.
getInstance()  : mixed
Get the binded instance.
to()  : jClassBinding
Bind the selector to the class specified Even if this instance is already defined (BE CAREFUL !!! singleton is bypassed).
toInstance()  : jClassBinding
Bind the selector to the specified instance Even if this instance is already defined (BE CAREFUL !!! singleton is bypassed).
_createInstance()  : mixed
Create the binded selector if not initialzed yet.
_getClassSelector()  : jSelectorClass
Get the selector to the binded class Protected because this does not work if called after a simple __construct() and a toInstance().

Properties

Methods

getClassName()

Get the name of the binded class without creating this class.

public getClassName() : string
Tags
Return values
string

getInstance()

Get the binded instance.

public getInstance([mixed $singleton = true ]) : mixed
Parameters
$singleton : mixed = true
Tags
Return values
mixed

to()

Bind the selector to the class specified Even if this instance is already defined (BE CAREFUL !!! singleton is bypassed).

public to(string $toselector) : jClassBinding
Parameters
$toselector : string
Tags
Return values
jClassBinding

$this

toInstance()

Bind the selector to the specified instance Even if this instance is already defined (BE CAREFUL !!! singleton is bypassed).

public toInstance(mixed $instance) : jClassBinding
Parameters
$instance : mixed
Tags
Return values
jClassBinding

$this

_createInstance()

Create the binded selector if not initialzed yet.

protected _createInstance() : mixed
Tags
Return values
mixed

Search results