Proyectos de Subversion LeadersLinked - Backend

Rev

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

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