Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev Autor Línea Nro. Línea
1 www 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 Laminas\ServiceManager\Factory\FactoryInterface;
10
use LeadersLinked\Controller\CompanyController;
3671 efrain 11
use Psr\Container\ContainerInterface;
6749 efrain 12
use LeadersLinked\Cache\CacheImpl;
1 www 13
 
14
class CompanyControllerFactory implements FactoryInterface
15
{
16
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
17
    {
18
 
19
        $db         = $container->get('leaders-linked-db');
6866 efrain 20
        $cache      = $container->get('leaders-linked-cache');
1 www 21
        $log        = $container->get('leaders-linked-log');
22
 
6866 efrain 23
        $translator     = $container->get('ServiceManager')->get('MvcTranslator');
24
        $config         = $container->get('ServiceManager')->get('config');
25
 
26
 
1 www 27
        $config = array_filter($config, function($k) {
28
            return strpos($k, 'leaderslinked.') !== false;
29
        }, ARRAY_FILTER_USE_KEY);
30
 
6866 efrain 31
        return new CompanyController($db, $cache, $log,  $config,  $translator);
1 www 32
    }
33
}