Proyectos de Subversion LeadersLinked - Services

Rev

Rev 262 | | Comparar con el anterior | Ultima modificación | Ver Log |

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