Proyectos de Subversion LeadersLinked - Backend

Rev

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

<?php

declare(strict_types=1);

namespace LeadersLinked\Factory\Plugin;

use Psr\Container\ContainerInterface;
use Laminas\ServiceManager\Factory\FactoryInterface;
use LeadersLinked\Plugin\CurrentUserPlugin;

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

        return CurrentUserPlugin::getInstance($config, $adapter);
    }
    
}