Jelix 1.6.40

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  : 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

Methods

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

Search results