Final Class Yiisoft\Definitions\DynamicReference
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
The DynamicReference defines a dependency to a service not defined in the container.
Definition may be defined multiple ways ({@see \
[
MyService::class => [
'__construct()' => [
DynamicReference::to([
'class' => SomeClass::class,
'$someProp' => 15
])
]
]
]
Public Methods
| Method | Description | Defined By |
|---|---|---|
| resolve() | Yiisoft\ |
|
| to() | Yiisoft\ |
Method Details
| public mixed resolve ( \ | ||
| $container | \ |
|
public function resolve(ContainerInterface $container): mixed
{
return $this->definition->resolve($container);
}
See also Yiisoft\
| public static self to ( mixed $id ) | ||
| $id | mixed | |
| throws | Yiisoft\ |
If definition is not valid. |
|---|---|---|
public static function to(mixed $id): self
{
return new self($id);
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.