Proyectos de Subversion LeadersLinked - Backend

Rev

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;
16766 efrain 9
use LeadersLinked\Cache\CacheImpl;
1 www 10
 
11
class CompanyControllerFactory implements FactoryInterface
12
{
13
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
14
    {
15
 
16
        $db         = $container->get('leaders-linked-db');
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
 
16766 efrain 24
 
16768 efrain 25
 
26
        return new CompanyController($db, $log,  $config);
1 www 27
    }
15391 efrain 28
}