Proyectos de Subversion LeadersLinked - Backend

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
17007 efrain 1
<?php
2
declare(strict_types=1);
3
 
4
namespace LeadersLinked\Factory\Controller;
5
 
6
use Psr\Container\ContainerInterface;
7
use Laminas\ServiceManager\Factory\FactoryInterface;
8
use LeadersLinked\Controller\HabitUserController;
9
use LeadersLinked\Cache\CacheImpl;
10
 
11
class HabitUserControllerFactory implements FactoryInterface
12
{
13
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
14
    {
15
        $db         = $container->get('leaders-linked-db');
16
        $cache      = $container->get('leaders-linked-cache');
17
        $log        = $container->get('leaders-linked-log');
18
 
19
        $translator     = $container->get('ServiceManager')->get('MvcTranslator');
20
        $config         = $container->get('ServiceManager')->get('config');
21
 
22
 
23
        $config = array_filter($config, function($k) {
24
            return strpos($k, 'leaderslinked.') !== false;
25
        }, ARRAY_FILTER_USE_KEY);
26
 
27
        return new HabitUserController($db, $cache, $log,  $config,  $translator);
28
    }
29
}