2021-05-21 08:49:41 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Xentral\Modules\ImportTemplate;
|
|
|
|
|
|
|
|
use Xentral\Core\DependencyInjection\ContainerInterface;
|
|
|
|
use Xentral\Modules\ImportTemplate\Service\ImportTemplateGateway;
|
|
|
|
use Xentral\Modules\ImportTemplate\Service\ImportTemplateJsonService;
|
|
|
|
use Xentral\Modules\ImportTemplate\Service\ImportTemplateService;
|
|
|
|
|
|
|
|
final class Bootstrap
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public static function registerServices()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'ImportTemplateJsonService' => 'onInitImportTemplateJsonService',
|
|
|
|
'ImportTemplateService' => 'onInitImportTemplateService',
|
|
|
|
'ImportTemplateGateway' => 'onInitImportTemplateGateway',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param ContainerInterface $container
|
|
|
|
*
|
|
|
|
* @return ImportTemplateJsonService
|
|
|
|
*/
|
|
|
|
public static function onInitImportTemplateJsonService(ContainerInterface $container)
|
|
|
|
{
|
|
|
|
return new ImportTemplateJsonService(
|
|
|
|
$container->get('ImportTemplateService'),
|
|
|
|
$container->get('ImportTemplateGateway')
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param ContainerInterface $container
|
|
|
|
*
|
|
|
|
* @return ImportTemplateService
|
|
|
|
*/
|
2024-04-01 12:46:31 +02:00
|
|
|
public static function onInitImportTemplateService(ContainerInterface $container)
|
2021-05-21 08:49:41 +02:00
|
|
|
{
|
|
|
|
return new ImportTemplateService(
|
|
|
|
$container->get('Database')
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param ContainerInterface $container
|
|
|
|
*
|
|
|
|
* @return ImportTemplateGateway
|
|
|
|
*/
|
2024-04-01 12:46:31 +02:00
|
|
|
public static function onInitImportTemplateGateway(ContainerInterface $container)
|
2021-05-21 08:49:41 +02:00
|
|
|
{
|
|
|
|
return new ImportTemplateGateway(
|
|
|
|
$container->get('Database')
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|