jClassBinding

Services binding for jelix

package

jelix

subpackage

utils

experimental

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

Methods

__constructor

__construct(\jSelectorIface|\jSelectorClass $selector) : void

Arguments

$selector

\jSelectorIface|\jSelectorClass

the selector of the class

Create the binded selector if not initialzed yet

_createInstance() : mixed

Response

mixed

Get the selector to the binded class Protected because this does not work if called after a simple __construct() and a toInstance()

_getClassSelector() : \jSelectorClass
Throws
\jException

Response

\jSelectorClass

Get the name of the binded class without creating this class

getClassName() : string

Response

string

Get the binded instance

getInstance( $singleton = true) : mixed

Arguments

$singleton

Response

mixed

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

to(string $toselector) : \jClassBinding

Arguments

$toselector

string

Response

\jClassBinding

$this

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

toInstance(mixed $instance) : \jClassBinding

Arguments

$instance

mixed

Response

\jClassBinding

$this

Properties

Called selector

fromSelector : \jSelectorIface|\jSelectorClass
var

Called selector

Type(s)

\jSelectorIface|\jSelectorClass

selector to the binded class (string form)

toSelector : \jSelectorClass
var

Type(s)

\jSelectorClass

resulting binded instance

instance : 

Type(s)