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
$instance
resulting binded instance.
protected
mixed
$instance
$toSelector
selector to the binded class (string form).
protected
jSelectorClass
$toSelector
Methods
__construct()
__constructor.
public
__construct(jSelectorClass|jSelectorIface $selector) : mixed
Parameters
- $selector : jSelectorClass|jSelectorIface
-
the selector of the class
Return values
mixed —getClassName()
Get the name of the binded class without creating this class.
public
getClassName() : string
Return values
string —getInstance()
Get the binded instance.
public
getInstance([mixed $singleton = true ]) : mixed
Parameters
- $singleton : mixed = true
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
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
Return values
jClassBinding —$this
_createInstance()
Create the binded selector if not initialzed yet.
protected
_createInstance() : mixed
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