class Configuration (View source)

Flow Object Configuration

Constants

AUTOWIRING_MODE_OFF

AUTOWIRING_MODE_ON

SCOPE_PROTOTYPE

SCOPE_SINGLETON

SCOPE_SESSION

Properties

protected string $objectName

Name of the object

protected string $className

Name of the class the object is based on

protected string $packageKey

Key of the package the specified object is part of

protected string $factoryObjectName

If set, specifies the factory object name used to create this object

protected string $factoryMethodName

Name of the factory method.

protected array $factoryArguments

Arguments of the factory method

protected string $scope
protected array $arguments

Arguments of the constructor detected by reflection

protected array $properties

Array of properties which are injected into the object

protected int $autowiring

Mode of the autowiring feature. One of the AUTOWIRINGMODE* constants

protected string $lifecycleInitializationMethodName

Name of the method to call during the initialization of the object (after dependencies are injected)

protected string $lifecycleShutdownMethodName

Name of the method to call during the shutdown of the framework

protected string $configurationSourceHint

Information about where this configuration has been created. Used in error messages to make debugging easier.

Methods

__construct(string $objectName, string $className = null)

The constructor

void
setObjectName(string $objectName)

Sets the object name

string
getObjectName()

Returns the object name

void
setClassName(string $className)

Setter function for property "className"

string
getClassName()

Returns the class name

void
setPackageKey(string $packageKey)

Sets the package key

string
getPackageKey()

Returns the package key

void
setFactoryObjectName(string $objectName)

Sets the class name of a factory which is in charge of instantiating this object

string
getFactoryObjectName()

Returns the class name of the factory for this object, if any

void
setFactoryMethodName(string $methodName)

Sets the name of the factory method

string
getFactoryMethodName()

Returns the factory method name

bool
isCreatedByFactory()

Returns true if factoryObjectName or factoryMethodName are defined.

void
setScope(int $scope)

Setter function for property "scope"

string
getScope()

Returns the scope for this object

void
setAutowiring(int $autowiring)

Setter function for property "autowiring"

int
getAutowiring()

Returns the autowiring mode for the configured object

void
setLifecycleInitializationMethodName(string $lifecycleInitializationMethodName)

Setter function for property "lifecycleInitializationMethodName"

string
getLifecycleInitializationMethodName()

Returns the name of the lifecycle initialization method for this object

void
setLifecycleShutdownMethodName(string $lifecycleShutdownMethodName)

Setter function for property "lifecycleShutdownMethodName"

string
getLifecycleShutdownMethodName()

Returns the name of the lifecycle shutdown method for this object

void
setProperties(array $properties)

Setter function for injection properties. If an empty array is passed to this method, all (possibly) defined properties are removed from the configuration.

getProperties()

Returns the currently set injection properties of the object

void
setProperty(ConfigurationProperty $property)

Setter function for a single injection property

void
setArguments(array $arguments)

Setter function for injection constructor arguments. If an empty array is passed to this method, all (possibly) defined constructor arguments are removed from the configuration.

void
setArgument(ConfigurationArgument $argument)

Setter function for a single constructor argument

getArguments()

Returns a sorted array of constructor arguments indexed by position (starting with "1")

void
setFactoryArgument(ConfigurationArgument $argument)

Setter function for a single factory method argument

getFactoryArguments()

Returns a sorted array of factory method arguments indexed by position (starting with "1")

void
setConfigurationSourceHint(string $hint)

Sets some information (hint) about where this configuration has been created.

string
getConfigurationSourceHint()

Returns some information (if any) about where this configuration has been created.

Details

__construct(string $objectName, string $className = null)

The constructor

Parameters

string $objectName

The unique identifier of the object

string $className

Name of the class which provides the functionality of this object

void setObjectName(string $objectName)

Sets the object name

Parameters

string $objectName

Return Value

void

string getObjectName()

Returns the object name

Return Value

string

object name

void setClassName(string $className)

Setter function for property "className"

Parameters

string $className

Name of the class which provides the functionality for this object

Return Value

void

string getClassName()

Returns the class name

Return Value

string

Name of the implementing class of this object

void setPackageKey(string $packageKey)

Sets the package key

Parameters

string $packageKey

Key of the package this object is part of

Return Value

void

string getPackageKey()

Returns the package key

Return Value

string

Key of the package this object is part of

void setFactoryObjectName(string $objectName)

Sets the class name of a factory which is in charge of instantiating this object

Parameters

string $objectName

Valid object name of a factory

Return Value

void

string getFactoryObjectName()

Returns the class name of the factory for this object, if any

Return Value

string

The factory class name

void setFactoryMethodName(string $methodName)

Sets the name of the factory method

Parameters

string $methodName

The factory method name

Return Value

void

Exceptions

InvalidArgumentException

string getFactoryMethodName()

Returns the factory method name

Return Value

string

The factory method name

bool isCreatedByFactory()

Returns true if factoryObjectName or factoryMethodName are defined.

Return Value

bool

void setScope(int $scope)

Setter function for property "scope"

Parameters

int $scope

Name of the scope

Return Value

void

string getScope()

Returns the scope for this object

Return Value

string

The scope, one of the SCOPE constants

void setAutowiring(int $autowiring)

Setter function for property "autowiring"

Parameters

int $autowiring

One of the AUTOWIRINGMODE* constants

Return Value

void

int getAutowiring()

Returns the autowiring mode for the configured object

Return Value

int

Value of one of the AUTOWIRINGMODE* constants

void setLifecycleInitializationMethodName(string $lifecycleInitializationMethodName)

Setter function for property "lifecycleInitializationMethodName"

Parameters

string $lifecycleInitializationMethodName

Name of the method to call after setter injection

Return Value

void

string getLifecycleInitializationMethodName()

Returns the name of the lifecycle initialization method for this object

Return Value

string

The name of the initialization method

void setLifecycleShutdownMethodName(string $lifecycleShutdownMethodName)

Setter function for property "lifecycleShutdownMethodName"

Parameters

string $lifecycleShutdownMethodName

Name of the method to call during shutdown of the framework

Return Value

void

string getLifecycleShutdownMethodName()

Returns the name of the lifecycle shutdown method for this object

Return Value

string

The name of the shutdown method

void setProperties(array $properties)

Setter function for injection properties. If an empty array is passed to this method, all (possibly) defined properties are removed from the configuration.

Parameters

array $properties

Array of ConfigurationProperty

Return Value

void

Exceptions

InvalidConfigurationException

ConfigurationProperty[] getProperties()

Returns the currently set injection properties of the object

Return Value

ConfigurationProperty[]

void setProperty(ConfigurationProperty $property)

Setter function for a single injection property

Parameters

ConfigurationProperty $property

Return Value

void

void setArguments(array $arguments)

Setter function for injection constructor arguments. If an empty array is passed to this method, all (possibly) defined constructor arguments are removed from the configuration.

Parameters

array $arguments

Return Value

void

Exceptions

InvalidConfigurationException

void setArgument(ConfigurationArgument $argument)

Setter function for a single constructor argument

Parameters

ConfigurationArgument $argument

The argument

Return Value

void

ConfigurationArgument[] getArguments()

Returns a sorted array of constructor arguments indexed by position (starting with "1")

Return Value

ConfigurationArgument[]

A sorted array of ConfigurationArgument objects with the argument position as index

void setFactoryArgument(ConfigurationArgument $argument)

Setter function for a single factory method argument

Parameters

ConfigurationArgument $argument

The argument

Return Value

void

ConfigurationArgument[] getFactoryArguments()

Returns a sorted array of factory method arguments indexed by position (starting with "1")

Return Value

ConfigurationArgument[]

A sorted array of ConfigurationArgument objects with the argument position as index

void setConfigurationSourceHint(string $hint)

Sets some information (hint) about where this configuration has been created.

Parameters

string $hint

The hint - e.g. the filename of the configuration file

Return Value

void

string getConfigurationSourceHint()

Returns some information (if any) about where this configuration has been created.

Return Value

string

The hint - e.g. the filename of the configuration file