jClassBinding
in package
Services binding for jelix.
Tags
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
$fromSelector
protected
jSelectorClass|jSelectorIface
$fromSelector
Called selector
Tags
$instance
resulting binded instance.
protected
mixed
$instance
Tags
$toSelector
selector to the binded class (string form).
protected
jSelectorClass
$toSelector
Tags
Methods
__construct()
__constructor.
public
__construct(jSelectorClass|jSelectorIface $selector) : mixed
Parameters
- $selector : jSelectorClass|jSelectorIface
-
the selector of the class
Tags
Return values
mixed —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 —_getClassSelector()
Get the selector to the binded class Protected because this does not work if called after a simple __construct() and a toInstance().
protected
_getClassSelector() : jSelectorClass