Object

Object node in XML file with Dependency Injection rules.

It represents created object.

package

Default

Methods

Initialize the object.

__construct(string $className, array $parameters = array(), string|null $alias = null,  $alwaysNew = false) 
Throws
\Dotpay\Exception\Loader\EmptyObjectNameException

Thrown when class name is empty

Arguments

$className

string

Class name of the object

$parameters

array

Array of Param object which are used during creation the object

$alias

string|null

A short name of the object

$alwaysNew

Return an alias of the object.

getAlias() : string|null

Response

string|null

Return a flag if the instance should be always new.

getAlwaysNew() : boolean

Response

boolean

Return a class name of the object.

getClass() : string

Response

string

Return an array of all Param objects for the object.

getParams() : array

Response

array

Return an identificator of the given data. It's a substitute of full serialization.

getParamsId(mixed $input) : string

Arguments

$input

mixed

Input data

Response

string

Return a value of a parameter which has the given name, if the parameter is in a set of named parameters.

getParamVal(string $name) : mixed

Arguments

$name

string

Name of the parameter

Response

mixed

Return an object which was created with the given set of params and which is set as an one of instances inside the Object.

getStoredInstance(array $params) : object|null

Arguments

$params

array

An array of params

Response

object|null

Return a string which contains XML representation of the Object.

getXml() : string

Response

string

Set a value to the parameter which has the given name, if the parameter is in a set of named parameters.

setParamVal(string $name, mixed $value) : object

Arguments

$name

string

A name of the parameter

$value

mixed

A value to set

Response

object

Set the instance of an object which was created with using the given set of params.

setStoredInstance(array $params, object $instance) : object

Arguments

$params

array

Params which were used to create the instance

$instance

object

An instance of a object which is the instance of the class represents by the Object

Response

object

Properties

Class name of the object

className : string
var

Class name of the object

Type(s)

string

Array of Param object which are used during creation the object

parameters : array
var

Array of Param object which are used during creation the object

Type(s)

array

Array of named prameters which contain Param objects

namedParameters : array
var

Array of named prameters which contain Param objects

Type(s)

array

A short name of the object. It's an alias on the main class name

alias : string|null
var

A short name of the object. It's an alias on the main class name

Type(s)

string|null

A flag if the instance should be always new

alwaysNew : boolean
var

A flag if the instance should be always new

Type(s)

boolean

Array of stored instances of the object for different sets of params used for an initialization

storedInstance : array
var

Array of stored instances of the object for different sets of params used for an initialization

Type(s)

array