Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 16768 | | 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
        $db         = $container->get('leaders-linked-db');
16769 efrain 16
        $cache      = $container->get('leaders-linked-cache');
1 www 17
        $log        = $container->get('leaders-linked-log');
18
 
16769 efrain 19
        $translator     = $container->get('ServiceManager')->get('MvcTranslator');
20
        $config         = $container->get('ServiceManager')->get('config');
21
 
22
 
1 www 23
        $config = array_filter($config, function($k) {
24
            return strpos($k, 'leaderslinked.') !== false;
25
        }, ARRAY_FILTER_USE_KEY);
26
 
16769 efrain 27
        return new CompanyController($db, $cache, $log,  $config,  $translator);
1 www 28
    }
15391 efrain 29
}