Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 15391 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |

<?php
declare(strict_types=1);

namespace LeadersLinked\Factory\Controller;

use Interop\Container\ContainerInterface;
use Laminas\ServiceManager\Factory\FactoryInterface;
use LeadersLinked\Controller\CompanyController;

class CompanyControllerFactory implements FactoryInterface
{
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
    {
        
        $db         = $container->get('leaders-linked-db');
        $cache      = $container->get('leaders-linked-cache');
        $log        = $container->get('leaders-linked-log');
        $config     = $container->get('ServiceManager')->get('config');
        
        $config = array_filter($config, function($k) {
            return strpos($k, 'leaderslinked.') !== false;
        }, ARRAY_FILTER_USE_KEY);
        
        return new CompanyController($db, $cache, $log,  $config);
    }
}