Symfony\Component\DependencyInjection\Definition::setFile PHP Method

setFile() public method

Sets a file to require before creating the service.
public setFile ( string $file ) : Definition
$file string A full pathname to include
return Definition The current instance
    public function setFile($file)
    {
        $this->file = $file;

        return $this;
    }

Usage Example

 /**
  * Load the MakeDo service.
  *
  * @param ContainerBuilder $container
  * @param array            $config
  */
 private function loadMakeDo(ContainerBuilder $container, array $config)
 {
     $definition = new Definition($config['service']);
     if (isset($config['file'])) {
         $definition->setFile($config['file']);
     }
     $container->setDefinition(self::MAKEDO_ID, $definition);
 }
All Usage Examples Of Symfony\Component\DependencyInjection\Definition::setFile