Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LazyTrait.php

function LazyTrait::lazy

Sets the lazy flag of this service.

Parameters

bool|string $lazy A FQCN to derivate the lazy proxy from or `true` to make it extend from the definition's class:

Return value

$this

File

vendor/symfony/dependency-injection/Loader/Configurator/Traits/LazyTrait.php, line 23

Class

LazyTrait

Namespace

Symfony\Component\DependencyInjection\Loader\Configurator\Traits

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal