31 lines
1.2 KiB
PHP
31 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Mautic\CoreBundle\DependencyInjection\MauticCoreExtension;
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
|
|
return function (ContainerConfigurator $configurator): void {
|
|
$services = $configurator->services()
|
|
->defaults()
|
|
->autowire()
|
|
->autoconfigure()
|
|
->public();
|
|
|
|
$excludes = [
|
|
'Tests',
|
|
];
|
|
|
|
$services->load('MauticPlugin\\PlanBundle\\', '../')
|
|
->exclude('../{'.implode(',', array_merge(MauticCoreExtension::DEFAULT_EXCLUDES, $excludes)).'}');
|
|
|
|
// Entity/ is excluded above; repositories must still be services for Doctrine to build them.
|
|
$services->load('MauticPlugin\\PlanBundle\\Entity\\', '../Entity/*Repository.php')
|
|
->tag(Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\ServiceRepositoryCompilerPass::REPOSITORY_SERVICE_TAG);
|
|
|
|
// Lets core resolve the model with getModel('plan') / getModel('plan.plan').
|
|
$services->alias('mautic.plan.model.plan', MauticPlugin\PlanBundle\Model\PlanModel::class);
|
|
// getModel('plan.task').
|
|
$services->alias('mautic.plan.model.task', MauticPlugin\PlanBundle\Model\TaskModel::class);
|
|
};
|