DI\Definition\ObjectDefinition::setLazy PHP Method

setLazy() public method

public setLazy ( boolean | null $lazy )
$lazy boolean | null
    public function setLazy($lazy)
    {
        $this->lazy = $lazy;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function getDefinition($entryName)
 {
     $definition = new ObjectDefinition($entryName, $this->className);
     if ($this->lazy !== null) {
         $definition->setLazy($this->lazy);
     }
     if ($this->scope !== null) {
         $definition->setScope($this->scope);
     }
     if (!empty($this->constructor)) {
         $parameters = $this->fixParameters($definition, '__construct', $this->constructor);
         $constructorInjection = MethodInjection::constructor($parameters);
         $definition->setConstructorInjection($constructorInjection);
     }
     if (!empty($this->properties)) {
         foreach ($this->properties as $property => $value) {
             $definition->addPropertyInjection(new PropertyInjection($property, $value));
         }
     }
     if (!empty($this->methods)) {
         foreach ($this->methods as $method => $calls) {
             foreach ($calls as $parameters) {
                 $parameters = $this->fixParameters($definition, $method, $parameters);
                 $methodInjection = new MethodInjection($method, $parameters);
                 $definition->addMethodInjection($methodInjection);
             }
         }
     }
     return $definition;
 }
All Usage Examples Of DI\Definition\ObjectDefinition::setLazy