OpenXE/classes/Modules/DownloadSpooler/Bootstrap.php

43 lines
1.0 KiB
PHP
Raw Normal View History

2021-05-21 08:49:41 +02:00
<?php
namespace Xentral\Modules\DownloadSpooler;
use Xentral\Core\DependencyInjection\ContainerInterface;
final class Bootstrap
{
/**
* @return array
*/
public static function registerServices()
{
return [
'DownloadSpoolerService' => 'onInitDownloadSpoolerService',
'DownloadSpoolerGateway' => 'onInitDownloadSpoolerGateway',
];
}
/**
* @param ContainerInterface $container
*
* @return DownloadSpoolerService
*/
public static function onInitDownloadSpoolerService(ContainerInterface $container)
{
/** @var \ApplicationCore $app */
$app = $container->get('LegacyApplication');
return new DownloadSpoolerService($container->get('Database'), $app->erp);
}
/**
* @param ContainerInterface $container
*
* @return DownloadSpoolerGateway
*/
public static function onInitDownloadSpoolerGateway(ContainerInterface $container)
{
return new DownloadSpoolerGateway($container->get('Database'));
}
}