Jelix 1.7.18

jClasses
in package

This object is responsible to include and instancy some classes stored in the classes directory of modules.

Tags
subpackage

utils

static

Table of Contents

$_bindings  : mixed
$_instances  : mixed
bind()  : jClassBinding
Get the binding corresponding to the specified selector.
create()  : object
include the given class and return an instance.
createBinded()  : object
Shortcut to corresponding jClassBinding::getInstance() but without singleton The binding is recreated each time (be careful about performance).
createInstance()  : mixed
alias of create method.
getBindedService()  : object
Shortcut to corresponding jClassBinding::getInstance().
getService()  : object
include the given class and return always the same instance.
inc()  : mixed
only include a class.
incIface()  : mixed
include an interface.
resetBindings()  : mixed
Reset the defined bindings (should only use it for unit tests).
__construct()  : mixed

Properties

Methods

bind()

Get the binding corresponding to the specified selector.

public static bind(string $selector) : jClassBinding

Better for use like this : jClasses::bind($selector)->getClassName().

Parameters
$selector : string
Tags
see
jClasses::bind
since
1.1
experimental

This method is EXPERIMENTAL. It could be changed in future version

Return values
jClassBinding

create()

include the given class and return an instance.

public static create(string $selector) : object
Parameters
$selector : string

the jelix selector correponding to the class

Return values
object

an instance of the classe

createBinded()

Shortcut to corresponding jClassBinding::getInstance() but without singleton The binding is recreated each time (be careful about performance).

public static createBinded(string $selector) : object
Parameters
$selector : string

Selector to a bindable class|interface

Tags
since
1.1
experimental

This method is EXPERIMENTAL. It could be changed in future version

Return values
object

Corresponding instance

createInstance()

alias of create method.

public static createInstance(mixed $selector) : mixed
Parameters
$selector : mixed
Tags
see
jClasses::create()
Return values
mixed

getBindedService()

Shortcut to corresponding jClassBinding::getInstance().

public static getBindedService(string $selector) : object
Parameters
$selector : string

Selector to a bindable class|interface

Tags
since
1.1
experimental

This method is EXPERIMENTAL. It could be changed in future version

Return values
object

Corresponding instance

getService()

include the given class and return always the same instance.

public static getService(string $selector) : object
Parameters
$selector : string

the jelix selector correponding to the class

Return values
object

an instance of the classe

inc()

only include a class.

public static inc(string $selector) : mixed
Parameters
$selector : string

the jelix selector correponding to the class

Return values
mixed

incIface()

include an interface.

public static incIface(string $selector) : mixed
Parameters
$selector : string

the jelix selector correponding to the interface

Tags
since
1.0b2
Return values
mixed

resetBindings()

Reset the defined bindings (should only use it for unit tests).

public static resetBindings() : mixed
Tags
since
1.1
experimental

This method is EXPERIMENTAL. It could be changed in future version

Return values
mixed

__construct()

private __construct() : mixed
Return values
mixed

Search results