PHP Класс Symfony\Component\DependencyInjection\Definition

Автор: Fabien Potencier ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$arguments

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный Метод

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() публичный Метод

Adds an argument to pass to the service constructor/factory method.
public addArgument ( mixed $argument ) : Definition
$argument mixed An argument
Результат Definition The current instance

addAutowiringType() публичный Метод

Adds a type that will default to this definition.
public addAutowiringType ( string $type ) : Definition
$type string
Результат Definition The current instance

addMethodCall() публичный Метод

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
Результат Definition The current instance

addTag() публичный Метод

Adds a tag for this definition.
public addTag ( string $name, array $attributes = [] ) : Definition
$name string The tag name
$attributes array An array of attributes
Результат Definition The current instance

clearTag() публичный Метод

Clears all tags for a given name.
public clearTag ( string $name ) : Definition
$name string The tag name
Результат Definition

clearTags() публичный Метод

Clears the tags for this definition.
public clearTags ( ) : Definition
Результат Definition The current instance

getArgument() публичный Метод

Gets an argument to pass to the service constructor/factory method.
public getArgument ( integer $index ) : mixed
$index integer
Результат mixed The argument value

getArguments() публичный Метод

Gets the arguments to pass to the service constructor/factory method.
public getArguments ( ) : array
Результат array The array of arguments

getAutowiredMethods() публичный Метод

Gets autowired methods.
public getAutowiredMethods ( ) : string[]
Результат string[]

getAutowiringTypes() публичный Метод

Gets autowiring types that will default to this definition.
public getAutowiringTypes ( ) : string[]
Результат string[]

getClass() публичный Метод

Gets the service class.
public getClass ( ) : string | null
Результат string | null The service class

getConfigurator() публичный Метод

Gets the configurator to call after the service is fully initialized.
public getConfigurator ( ) : callable | null
Результат callable | null The PHP callable to call

getDecoratedService() публичный Метод

Gets the service that decorates this service.
public getDecoratedService ( ) : null | array
Результат 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() публичный Метод

Message to use if this definition is deprecated.
public getDeprecationMessage ( string $id ) : string
$id string Service id relying on this definition
Результат string

getFactory() публичный Метод

Gets the factory.
public getFactory ( ) : string | array
Результат string | array The PHP function or an array containing a class/Reference and a method to call

getFile() публичный Метод

Gets the file to require before creating the service.
public getFile ( ) : string | null
Результат string | null The full pathname to include

getMethodCalls() публичный Метод

Gets the methods to call after service initialization.
public getMethodCalls ( ) : array
Результат array An array of method calls

getProperties() публичный Метод

public getProperties ( )

getTag() публичный Метод

Gets a tag by name.
public getTag ( string $name ) : array
$name string The tag name
Результат array An array of attributes

getTags() публичный Метод

Returns all tags.
public getTags ( ) : array
Результат array An array of tags

hasAutowiringType() публичный Метод

Will this definition default for the given type?
public hasAutowiringType ( string $type ) : boolean
$type string
Результат boolean

hasMethodCall() публичный Метод

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
Результат boolean

hasTag() публичный Метод

Whether this definition has a tag with the given name.
public hasTag ( string $name ) : boolean
$name string
Результат boolean

isAbstract() публичный Метод

Whether this definition is abstract, that means it merely serves as a template for other definitions.
public isAbstract ( ) : boolean
Результат boolean

isAutowired() публичный Метод

Is the definition autowired?
public isAutowired ( ) : boolean
Результат boolean

isDeprecated() публичный Метод

Whether this definition is deprecated, that means it should not be called anymore.
public isDeprecated ( ) : boolean
Результат boolean

isLazy() публичный Метод

Whether this service is lazy.
public isLazy ( ) : boolean
Результат boolean

isPublic() публичный Метод

Whether this service is public facing.
public isPublic ( ) : boolean
Результат boolean

isShared() публичный Метод

Whether this service is shared.
public isShared ( ) : boolean
Результат boolean

isSynthetic() публичный Метод

Whether this definition is synthetic, that is not constructed by the container, but dynamically injected.
public isSynthetic ( ) : boolean
Результат boolean

removeAutowiringType() публичный Метод

Removes a type.
public removeAutowiringType ( string $type ) : Definition
$type string
Результат Definition The current instance

removeMethodCall() публичный Метод

Removes a method to call after service initialization.
public removeMethodCall ( string $method ) : Definition
$method string The method name to remove
Результат Definition The current instance

replaceArgument() публичный Метод

Sets a specific argument.
public replaceArgument ( integer $index, mixed $argument ) : Definition
$index integer
$argument mixed
Результат Definition The current instance

setAbstract() публичный Метод

Whether this definition is abstract, that means it merely serves as a template for other definitions.
public setAbstract ( boolean $boolean ) : Definition
$boolean boolean
Результат Definition the current instance

setArguments() публичный Метод

Sets the arguments to pass to the service constructor/factory method.
public setArguments ( array $arguments ) : Definition
$arguments array An array of arguments
Результат Definition The current instance

setAutowired() публичный Метод

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
Результат Definition The current instance

setAutowiredMethods() публичный Метод

Example of allowed value: - array('__construct', 'set*', 'initialize'): autowire whitelisted methods only
public setAutowiredMethods ( array $autowiredMethods ) : Definition
$autowiredMethods array
Результат Definition The current instance

setAutowiringTypes() публичный Метод

Sets types that will default to this definition.
public setAutowiringTypes ( array $types ) : Definition
$types array
Результат Definition The current instance

setClass() публичный Метод

Sets the service class.
public setClass ( string $class ) : Definition
$class string The service class
Результат Definition The current instance

setConfigurator() публичный Метод

Sets a configurator to call after the service is fully initialized.
public setConfigurator ( string | array $configurator ) : Definition
$configurator string | array A PHP callable
Результат Definition The current instance

setDecoratedService() публичный Метод

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
Результат Definition The current instance

setDeprecated() публичный Метод

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
Результат Definition the current instance

setFactory() публичный Метод

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
Результат Definition The current instance

setFile() публичный Метод

Sets a file to require before creating the service.
public setFile ( string $file ) : Definition
$file string A full pathname to include
Результат Definition The current instance

setLazy() публичный Метод

Sets the lazy flag of this service.
public setLazy ( boolean $lazy ) : Definition
$lazy boolean
Результат Definition The current instance

setMethodCalls() публичный Метод

Sets the methods to call after service initialization.
public setMethodCalls ( array $calls = [] ) : Definition
$calls array An array of method calls
Результат Definition The current instance

setProperties() публичный Метод

public setProperties ( array $properties )
$properties array

setProperty() публичный Метод

public setProperty ( $name, $value )

setPublic() публичный Метод

Sets the visibility of this service.
public setPublic ( boolean $boolean ) : Definition
$boolean boolean
Результат Definition The current instance

setShared() публичный Метод

Sets if the service must be shared or not.
public setShared ( boolean $shared ) : Definition
$shared boolean Whether the service must be shared or not
Результат Definition The current instance

setSynthetic() публичный Метод

Sets whether this definition is synthetic, that is not constructed by the container, but dynamically injected.
public setSynthetic ( boolean $boolean ) : Definition
$boolean boolean
Результат Definition the current instance

setTags() публичный Метод

Sets tags for this definition.
public setTags ( array $tags ) : Definition
$tags array
Результат Definition the current instance

Описание свойств

$arguments защищенное свойство

protected $arguments