init
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Bx\Discount\Providers;
|
||||
|
||||
use Bx\Discount\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);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Bx\Discount\Providers;
|
||||
|
||||
use Wt\Core\Interfaces\IApp;
|
||||
use Wt\Core\Providers\ADefaultServiceProvider;
|
||||
|
||||
class DefaultServiceProvider extends ADefaultServiceProvider
|
||||
{
|
||||
|
||||
public function register(IApp $app)
|
||||
{
|
||||
parent::register($app);
|
||||
|
||||
$container = $this->app->container();
|
||||
$config = $this->app->config();
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user