jClassBinding
in package
Services binding for jelix
Tags
Table of Contents
- $fromSelector : jSelectorIface|jSelectorClass
- $instance : mixed
- resulting binded instance
- $toSelector : jSelectorClass
- selector to the binded class (string form)
- __construct() : void
- __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
jSelectorIface|jSelectorClass
$fromSelector
=
ull
Called selector
$instance
resulting binded instance
protected
mixed
$instance
=
ull
$toSelector
selector to the binded class (string form)
protected
jSelectorClass
$toSelector
=
ull
Methods
__construct()
__constructor
public
__construct(jSelectorIface|jSelectorClass $selector) : void
Parameters
- $selector : jSelectorIface|jSelectorClass
-
the selector of the class
Return values
void —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