Files
bx.nullable/lib/providers/defaultfactoryprovider.php
T
2023-09-04 23:48:46 +03:00

25 lines
670 B
PHP

<?php
namespace Bx\Null\Providers;
use Bx\Null\AbstractFactory\MainAbstractFactory;
use Wt\Core\Interfaces\IApp;
use Wt\Core\Interfaces\IServiceProvider;
class DefaultFactoryProvider implements IServiceProvider
{
public function register(IApp $app)
{
$config = $app->config();
$serviceContainer = $app->container();
/**
* @var $mainAbstractFactory MainAbstractFactory
*/
$mainAbstractFactory = $serviceContainer->make(MainAbstractFactory::class, [$config->get('MainAbstractFactory', [])]);
$serviceContainer->singleton($app->module()->getId().':mainAbstractFactory', $mainAbstractFactory);
}
}