?? GreyFile — Mystic File Browser

Current path: home/webdevt/cryptoimpot.fr/module/User/src/Service/Factory/



?? Go up: /home/webdevt/cryptoimpot.fr/module/User/src/Service

?? Viewing: AuthAdapterFactory.php

<?php
namespace User\Service\Factory;

use Psr\Container\ContainerInterface;
use User\Service\AuthAdapter;
use Laminas\ServiceManager\Factory\FactoryInterface;

/**
 * This is the factory class for AuthAdapter service. The purpose of the factory
 * is to instantiate the service and pass it dependencies (inject dependencies).
 */
class AuthAdapterFactory
{
    /**
     * This method creates the AuthAdapter service and returns its instance. 
     */
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
    {        
        // Get Doctrine entity manager from Service Manager.
        $entityManager = $container->get('doctrine.entitymanager.orm_default');        
                        
        // Create the AuthAdapter and inject dependency to its constructor.
        return new AuthAdapter($entityManager);
    }
}


??

??