mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-15 04:27:14 +01:00
48 lines
1.2 KiB
PHP
48 lines
1.2 KiB
PHP
|
<?php
|
||
|
/*
|
||
|
* SPDX-FileCopyrightText: 2023 Andreas Palm
|
||
|
* SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||
|
*/
|
||
|
|
||
|
namespace Xentral\Modules\MatrixProduct;
|
||
|
|
||
|
use Xentral\Core\DependencyInjection\ContainerInterface;
|
||
|
|
||
|
final class Bootstrap
|
||
|
{
|
||
|
/**
|
||
|
* @return array
|
||
|
*/
|
||
|
public static function registerServices()
|
||
|
{
|
||
|
return [
|
||
|
'MatrixProductService' => 'onInitMatrixProductService',
|
||
|
'MatrixProductGateway' => 'onInitMatrixProductGateway',
|
||
|
];
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param ContainerInterface $container
|
||
|
*
|
||
|
* @return MatrixProductService
|
||
|
*/
|
||
|
public static function onInitMatrixProductService(ContainerInterface $container) : MatrixProductService
|
||
|
{
|
||
|
return new MatrixProductService(
|
||
|
$container->get('Database'),
|
||
|
$container->get('MatrixProductGateway'),
|
||
|
$container->get('ArticleGateway')
|
||
|
);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param ContainerInterface $container
|
||
|
*
|
||
|
* @return MatrixProductGateway
|
||
|
*/
|
||
|
public static function onInitMatrixProductGateway(ContainerInterface $container) : MatrixProductGateway
|
||
|
{
|
||
|
return new MatrixProductGateway($container->get('Database'));
|
||
|
}
|
||
|
}
|