trait LazyTrait
Hierarchy
- trait \Symfony\Component\DependencyInjection\Loader\Configurator\Traits\LazyTrait
File
-
vendor/
symfony/ dependency-injection/ Loader/ Configurator/ Traits/ LazyTrait.php, line 14
Namespace
Symfony\Component\DependencyInjection\Loader\Configurator\TraitsView source
trait LazyTrait {
/**
* Sets the lazy flag of this service.
*
* @param bool|string $lazy A FQCN to derivate the lazy proxy from or `true` to make it extend from the definition's class
*
* @return $this
*/
public final function lazy(bool|string $lazy = true) : static {
$this->definition
->setLazy((bool) $lazy);
if (\is_string($lazy)) {
$this->definition
->addTag('proxy', [
'interface' => $lazy,
]);
}
return $this;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
LazyTrait::lazy | final public | function | Sets the lazy flag of this service. |