Initial xentral_oss_20.3.c9ffacf
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Modules\Ticket;
|
||||
|
||||
use Ticket;
|
||||
use Xentral\Core\DependencyInjection\ContainerInterface;
|
||||
use Xentral\Modules\Api\LegacyBridge\LegacyApplication;
|
||||
use Xentral\Modules\Ticket\Importer\TicketFormatter;
|
||||
use Xentral\Modules\Ticket\Task\TicketImportHelperFactory;
|
||||
|
||||
final class Bootstrap
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function registerServices(): array
|
||||
{
|
||||
return [
|
||||
'TicketFormatter' => 'onInitTicketFormatter',
|
||||
'TicketImportHelperFactory' => 'onInitTicketImportHelperFactory',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*
|
||||
* @return TicketFormatter
|
||||
*/
|
||||
public static function onInitTicketFormatter(ContainerInterface $container): TicketFormatter
|
||||
{
|
||||
return new TicketFormatter();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*
|
||||
* @return TicketImportHelperFactory
|
||||
*/
|
||||
public static function onInitTicketImportHelperFactory(ContainerInterface $container): TicketImportHelperFactory
|
||||
{
|
||||
/** @var LegacyApplication $app */
|
||||
$app = $container->get('LegacyApplication');
|
||||
/** @var Ticket $ticketModule */
|
||||
$ticketModule = $ticketModule = $app->erp->LoadModul('ticket');
|
||||
|
||||
return new TicketImportHelperFactory(
|
||||
$app->DB,
|
||||
$app->erp,
|
||||
$app->Conf,
|
||||
$ticketModule,
|
||||
$container->get('TicketFormatter'),
|
||||
$container->get('Logger')
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user