PHP Class Symfony\Component\DependencyInjection\Definition

Author: Fabien Potencier ([email protected])
Afficher le fichier Open project: symfony/symfony Class Usage Examples

Protected Properties

Свойство Type Description
$arguments

Méthodes publiques

Méthode Description
__construct ( string | null $class = null, array $arguments = [] )
addArgument ( mixed $argument ) : Definition Adds an argument to pass to the service constructor/factory method.
addAutowiringType ( string $type ) : Definition Adds a type that will default to this definition.
addMethodCall ( string $method, array $arguments = [] ) : Definition Adds a method to call after service initialization.
addTag ( string $name, array $attributes = [] ) : Definition Adds a tag for this definition.
clearTag ( string $name ) : Definition Clears all tags for a given name.
clearTags ( ) : Definition Clears the tags for this definition.
getArgument ( integer $index ) : mixed Gets an argument to pass to the service constructor/factory method.
getArguments ( ) : array Gets the arguments to pass to the service constructor/factory method.
getAutowiredMethods ( ) : string[] Gets autowired methods.
getAutowiringTypes ( ) : string[] Gets autowiring types that will default to this definition.
getClass ( ) : string | null Gets the service class.
getConfigurator ( ) : callable | null Gets the configurator to call after the service is fully initialized.
getDecoratedService ( ) : null | array Gets the service that decorates this service.
getDeprecationMessage ( string $id ) : string Message to use if this definition is deprecated.
getFactory ( ) : string | array Gets the factory.
getFile ( ) : string | null Gets the file to require before creating the service.
getMethodCalls ( ) : array Gets the methods to call after service initialization.
getProperties ( )
getTag ( string $name ) : array Gets a tag by name.
getTags ( ) : array Returns all tags.
hasAutowiringType ( string $type ) : boolean Will this definition default for the given type?
hasMethodCall ( string $method ) : boolean Check if the current definition has a given method to call after service initialization.
hasTag ( string $name ) : boolean Whether this definition has a tag with the given name.
isAbstract ( ) : boolean Whether this definition is abstract, that means it merely serves as a template for other definitions.
isAutowired ( ) : boolean Is the definition autowired?
isDeprecated ( ) : boolean Whether this definition is deprecated, that means it should not be called anymore.
isLazy ( ) : boolean Whether this service is lazy.
isPublic ( ) : boolean Whether this service is public facing.
isShared ( ) : boolean Whether this service is shared.
isSynthetic ( ) : boolean Whether this definition is synthetic, that is not constructed by the container, but dynamically injected.
removeAutowiringType ( string $type ) : Definition Removes a type.
removeMethodCall ( string $method ) : Definition Removes a method to call after service initialization.
replaceArgument ( integer $index, mixed $argument ) : Definition Sets a specific argument.
setAbstract ( boolean $boolean ) : Definition Whether this definition is abstract, that means it merely serves as a template for other definitions.
setArguments ( array $arguments ) : Definition Sets the arguments to pass to the service constructor/factory method.
setAutowired ( boolean $autowired ) : Definition Sets autowired.
setAutowiredMethods ( array $autowiredMethods ) : Definition Sets autowired methods.
setAutowiringTypes ( array $types ) : Definition Sets types that will default to this definition.
setClass ( string $class ) : Definition Sets the service class.
setConfigurator ( string | array $configurator ) : Definition Sets a configurator to call after the service is fully initialized.
setDecoratedService ( null | string $id, null | string $renamedId = null, integer $priority ) : Definition Sets the service that this service is decorating.
setDeprecated ( boolean $status = true, string $template = null ) : Definition Whether this definition is deprecated, that means it should not be called anymore.
setFactory ( string | array $factory ) : Definition Sets a factory.
setFile ( string $file ) : Definition Sets a file to require before creating the service.
setLazy ( boolean $lazy ) : Definition Sets the lazy flag of this service.
setMethodCalls ( array $calls = [] ) : Definition Sets the methods to call after service initialization.
setProperties ( array $properties )
setProperty ( $name, $value )
setPublic ( boolean $boolean ) : Definition Sets the visibility of this service.
setShared ( boolean $shared ) : Definition Sets if the service must be shared or not.
setSynthetic ( boolean $boolean ) : Definition Sets whether this definition is synthetic, that is not constructed by the container, but dynamically injected.
setTags ( array $tags ) : Definition Sets tags for this definition.

Method Details

__construct() public méthode

public __construct ( string | null $class = null, array $arguments = [] )
$class string | null The service class
$arguments array An array of arguments to pass to the service constructor

addArgument() public méthode

Adds an argument to pass to the service constructor/factory method.
public addArgument ( mixed $argument ) : Definition
$argument mixed An argument
Résultat Definition The current instance

addAutowiringType() public méthode

Adds a type that will default to this definition.
public addAutowiringType ( string $type ) : Definition
$type string
Résultat Definition The current instance

addMethodCall() public méthode

Adds a method to call after service initialization.
public addMethodCall ( string $method, array $arguments = [] ) : Definition
$method string The method name to call
$arguments array An array of arguments to pass to the method call
Résultat Definition The current instance

addTag() public méthode

Adds a tag for this definition.
public addTag ( string $name, array $attributes = [] ) : Definition
$name string The tag name
$attributes array An array of attributes
Résultat Definition The current instance

clearTag() public méthode

Clears all tags for a given name.
public clearTag ( string $name ) : Definition
$name string The tag name
Résultat Definition

clearTags() public méthode

Clears the tags for this definition.
public clearTags ( ) : Definition
Résultat Definition The current instance

getArgument() public méthode

Gets an argument to pass to the service constructor/factory method.
public getArgument ( integer $index ) : mixed
$index integer
Résultat mixed The argument value

getArguments() public méthode

Gets the arguments to pass to the service constructor/factory method.
public getArguments ( ) : array
Résultat array The array of arguments

getAutowiredMethods() public méthode

Gets autowired methods.
public getAutowiredMethods ( ) : string[]
Résultat string[]

getAutowiringTypes() public méthode

Gets autowiring types that will default to this definition.
public getAutowiringTypes ( ) : string[]
Résultat string[]

getClass() public méthode

Gets the service class.
public getClass ( ) : string | null
Résultat string | null The service class

getConfigurator() public méthode

Gets the configurator to call after the service is fully initialized.
public getConfigurator ( ) : callable | null
Résultat callable | null The PHP callable to call

getDecoratedService() public méthode

Gets the service that decorates this service.
public getDecoratedService ( ) : null | array
Résultat null | array An array composed of the decorated service id, the new id for it and the priority of decoration, null if no service is decorated

getDeprecationMessage() public méthode

Message to use if this definition is deprecated.
public getDeprecationMessage ( string $id ) : string
$id string Service id relying on this definition
Résultat string

getFactory() public méthode

Gets the factory.
public getFactory ( ) : string | array
Résultat string | array The PHP function or an array containing a class/Reference and a method to call

getFile() public méthode

Gets the file to require before creating the service.
public getFile ( ) : string | null
Résultat string | null The full pathname to include

getMethodCalls() public méthode

Gets the methods to call after service initialization.
public getMethodCalls ( ) : array
Résultat array An array of method calls

getProperties() public méthode

public getProperties ( )

getTag() public méthode

Gets a tag by name.
public getTag ( string $name ) : array
$name string The tag name
Résultat array An array of attributes

getTags() public méthode

Returns all tags.
public getTags ( ) : array
Résultat array An array of tags

hasAutowiringType() public méthode

Will this definition default for the given type?
public hasAutowiringType ( string $type ) : boolean
$type string
Résultat boolean

hasMethodCall() public méthode

Check if the current definition has a given method to call after service initialization.
public hasMethodCall ( string $method ) : boolean
$method string The method name to search for
Résultat boolean

hasTag() public méthode

Whether this definition has a tag with the given name.
public hasTag ( string $name ) : boolean
$name string
Résultat boolean

isAbstract() public méthode

Whether this definition is abstract, that means it merely serves as a template for other definitions.
public isAbstract ( ) : boolean
Résultat boolean

isAutowired() public méthode

Is the definition autowired?
public isAutowired ( ) : boolean
Résultat boolean

isDeprecated() public méthode

Whether this definition is deprecated, that means it should not be called anymore.
public isDeprecated ( ) : boolean
Résultat boolean

isLazy() public méthode

Whether this service is lazy.
public isLazy ( ) : boolean
Résultat boolean

isPublic() public méthode

Whether this service is public facing.
public isPublic ( ) : boolean
Résultat boolean

isShared() public méthode

Whether this service is shared.
public isShared ( ) : boolean
Résultat boolean

isSynthetic() public méthode

Whether this definition is synthetic, that is not constructed by the container, but dynamically injected.
public isSynthetic ( ) : boolean
Résultat boolean

removeAutowiringType() public méthode

Removes a type.
public removeAutowiringType ( string $type ) : Definition
$type string
Résultat Definition The current instance

removeMethodCall() public méthode

Removes a method to call after service initialization.
public removeMethodCall ( string $method ) : Definition
$method string The method name to remove
Résultat Definition The current instance

replaceArgument() public méthode

Sets a specific argument.
public replaceArgument ( integer $index, mixed $argument ) : Definition
$index integer
$argument mixed
Résultat Definition The current instance

setAbstract() public méthode

Whether this definition is abstract, that means it merely serves as a template for other definitions.
public setAbstract ( boolean $boolean ) : Definition
$boolean boolean
Résultat Definition the current instance

setArguments() public méthode

Sets the arguments to pass to the service constructor/factory method.
public setArguments ( array $arguments ) : Definition
$arguments array An array of arguments
Résultat Definition The current instance

setAutowired() public méthode

Allowed values: - true: constructor autowiring, same as $this->setAutowiredMethods(array('__construct')) - false: no autowiring, same as $this->setAutowiredMethods(array())
public setAutowired ( boolean $autowired ) : Definition
$autowired boolean
Résultat Definition The current instance

setAutowiredMethods() public méthode

Example of allowed value: - array('__construct', 'set*', 'initialize'): autowire whitelisted methods only
public setAutowiredMethods ( array $autowiredMethods ) : Definition
$autowiredMethods array
Résultat Definition The current instance

setAutowiringTypes() public méthode

Sets types that will default to this definition.
public setAutowiringTypes ( array $types ) : Definition
$types array
Résultat Definition The current instance

setClass() public méthode

Sets the service class.
public setClass ( string $class ) : Definition
$class string The service class
Résultat Definition The current instance

setConfigurator() public méthode

Sets a configurator to call after the service is fully initialized.
public setConfigurator ( string | array $configurator ) : Definition
$configurator string | array A PHP callable
Résultat Definition The current instance

setDecoratedService() public méthode

Sets the service that this service is decorating.
public setDecoratedService ( null | string $id, null | string $renamedId = null, integer $priority ) : Definition
$id null | string The decorated service id, use null to remove decoration
$renamedId null | string The new decorated service id
$priority integer The priority of decoration
Résultat Definition The current instance

setDeprecated() public méthode

Whether this definition is deprecated, that means it should not be called anymore.
public setDeprecated ( boolean $status = true, string $template = null ) : Definition
$status boolean
$template string Template message to use if the definition is deprecated
Résultat Definition the current instance

setFactory() public méthode

Sets a factory.
public setFactory ( string | array $factory ) : Definition
$factory string | array A PHP function or an array containing a class/Reference and a method to call
Résultat Definition The current instance

setFile() public méthode

Sets a file to require before creating the service.
public setFile ( string $file ) : Definition
$file string A full pathname to include
Résultat Definition The current instance

setLazy() public méthode

Sets the lazy flag of this service.
public setLazy ( boolean $lazy ) : Definition
$lazy boolean
Résultat Definition The current instance

setMethodCalls() public méthode

Sets the methods to call after service initialization.
public setMethodCalls ( array $calls = [] ) : Definition
$calls array An array of method calls
Résultat Definition The current instance

setProperties() public méthode

public setProperties ( array $properties )
$properties array

setProperty() public méthode

public setProperty ( $name, $value )

setPublic() public méthode

Sets the visibility of this service.
public setPublic ( boolean $boolean ) : Definition
$boolean boolean
Résultat Definition The current instance

setShared() public méthode

Sets if the service must be shared or not.
public setShared ( boolean $shared ) : Definition
$shared boolean Whether the service must be shared or not
Résultat Definition The current instance

setSynthetic() public méthode

Sets whether this definition is synthetic, that is not constructed by the container, but dynamically injected.
public setSynthetic ( boolean $boolean ) : Definition
$boolean boolean
Résultat Definition the current instance

setTags() public méthode

Sets tags for this definition.
public setTags ( array $tags ) : Definition
$tags array
Résultat Definition the current instance

Property Details

$arguments protected_oe property

protected $arguments