Proyectos de Subversion LeadersLinked - Services

Rev

| Ultima modificación | Ver Log |

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