OpenXE/classes/Modules/Company/Bootstrap.php
2021-05-21 08:49:41 +02:00

45 lines
1.3 KiB
PHP

<?php
namespace Xentral\Modules\Company;
use Xentral\Core\DependencyInjection\ContainerInterface;
use Xentral\Modules\Company\Service\DocumentCustomizationService;
use Xentral\Modules\Company\Service\DocumentCustomizationBlockParser;
final class Bootstrap
{
/**
* @return array
*/
public static function registerServices()
{
return [
'DocumentCustomizationService' => 'onInitDocumentCustomizationService',
'DocumentCustomizationBlockParser' => 'onInitDocumentCustomizationBlockParser',
];
}
/**
* @param ContainerInterface $container
*
* @return DocumentCustomizationService
*/
public static function onInitDocumentCustomizationService(ContainerInterface $container)
{
return new DocumentCustomizationService(
$container->get('Database'),
$container->get('DocumentCustomizationBlockParser')
);
}
/**
* @param ContainerInterface $container
*
* @return DocumentCustomizationBlockParser
*/
public static function onInitDocumentCustomizationBlockParser(ContainerInterface $container)
{
$erp = $container->get('LegacyApplication')->erp;
return new DocumentCustomizationBlockParser($erp);
}
}