Whether this definition is abstract, that means it merely serves as a
template for other definitions.
public isAbstract ( ) : boolean | ||
return | boolean |
use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\ContainerBuilder; $logger = new Definition(); $logger->setAbstract(true); $containerBuilder = new ContainerBuilder(); $containerBuilder->setDefinition('logger', $logger);In this example, we have created an abstract service named "logger" using the Definition object. We have marked it as abstract using the setAbstract method. Finally, we have added this service to the container using the setDefinition method. Package/Library: Symfony\Component\DependencyInjection
public isAbstract ( ) : boolean | ||
return | boolean |