jClasses
in package
This object is responsible to include and instancy some classes stored in the classes directory of modules.
Tags
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
$_bindings
protected
static mixed
$_bindings
= array()
$_instances
protected
static mixed
$_instances
= array()
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
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
Return values
object —Corresponding instance
createInstance()
alias of create method.
public
static createInstance(mixed $selector) : mixed
Parameters
- $selector : mixed
Tags
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
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
Return values
mixed —resetBindings()
Reset the defined bindings (should only use it for unit tests).
public
static resetBindings() : mixed
Tags
Return values
mixed —__construct()
private
__construct() : mixed