Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 16768 | Ir a la última revisión | | Ultima modificación | Ver Log |

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