Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 1 | Rev 16766 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

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