mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
remove container aware interface from timeline builder
This commit is contained in:
parent
6a37079ee5
commit
41f4bbfdce
@ -14,21 +14,19 @@ namespace Chill\MainBundle\Timeline;
|
||||
use DateTime;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\ORM\Query\ResultSetMapping;
|
||||
use LogicException;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
|
||||
use Twig\Environment;
|
||||
use function array_key_exists;
|
||||
use function is_string;
|
||||
|
||||
/**
|
||||
* Build timeline.
|
||||
*/
|
||||
class TimelineBuilder implements ContainerAwareInterface
|
||||
class TimelineBuilder
|
||||
{
|
||||
use \Symfony\Component\DependencyInjection\ContainerAwareTrait;
|
||||
|
||||
/**
|
||||
* Record provider.
|
||||
*
|
||||
@ -45,7 +43,7 @@ class TimelineBuilder implements ContainerAwareInterface
|
||||
*/
|
||||
private array $providersByContext = [];
|
||||
|
||||
public function __construct(private readonly EntityManagerInterface $em) {}
|
||||
public function __construct(private readonly EntityManagerInterface $em, private readonly Environment $twig) {}
|
||||
|
||||
/**
|
||||
* add a provider id.
|
||||
@ -291,7 +289,7 @@ class TimelineBuilder implements ContainerAwareInterface
|
||||
];
|
||||
}
|
||||
|
||||
return $this->container->get('templating')
|
||||
return $this->twig
|
||||
->render('@ChillMain/Timeline/chain_timelines.html.twig', [
|
||||
'results' => $timelineEntries,
|
||||
]);
|
||||
|
@ -5,10 +5,6 @@ services:
|
||||
|
||||
chill_main.timeline_builder:
|
||||
class: Chill\MainBundle\Timeline\TimelineBuilder
|
||||
arguments:
|
||||
- "@doctrine.orm.entity_manager"
|
||||
calls:
|
||||
- [ setContainer, ["@service_container"]]
|
||||
# alias:
|
||||
Chill\MainBundle\Timeline\TimelineBuilder: '@chill_main.timeline_builder'
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user