{@inheritdoc}
@return AdapterInterface
489490
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = (array) $serviceLocator->get('Config');
        $this->validate($config);

        $hashIdconfig = $config['crypt']['hashid'];
        $hashIds = new HashIds(
            $hashIdconfig['sault'],
            $hashIdconfig['minLength'],
            $hashIdconfig['chars']
        );

        return new HashIdAdapter($hashIds);
    }
600842
public function getAdapter()
    {
        if (isset($this->adapter)) {
            return $this->adapter;
        }
        
        $options = $this->getOptions();
        if (isset($options['connection'])) {
            if (!($options['connection'] instanceof \PDO)) {
                throw new \RuntimeException('The specified connection is not a PDO instance');
            }

            $options['connection']->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
            $options['adapter'] = $options['connection']->getAttribute(\PDO::ATTR_DRIVER_NAME);
        }
        if (!isset($options['adapter'])) {
            throw new \RuntimeException('No adapter was specified for environment: ' . $this->getName());
        }

        $factory = AdapterFactory::instance();
        $adapter = $factory
            ->getAdapter($options['adapter'], $options);

        // Automatically time the executed commands
        $adapter = $factory->getWrapper('timed', $adapter);

        if (isset($options['wrapper'])) {
            $adapter = $factory
                ->getWrapper($options['wrapper'], $adapter);
        }

        if ($this->getInput()) {
            $adapter->setInput($this->getInput());
        }

        if ($this->getOutput()) {
            $adapter->setOutput($this->getOutput());
        }

        // Use the TablePrefixAdapter if table prefix/suffixes are in use
        if ($adapter->hasOption('table_prefix') || $adapter->hasOption('table_suffix')) {
            $adapter = AdapterFactory::instance()
                ->getWrapper('prefix', $adapter);
        }

        $this->setAdapter($adapter);

        return $adapter;
    }
507708
public function connectAdapter($adaptee)
    {
        $adapter = new $this->adapter($this->config);

        return $adapter
            ->setAdaptee($adaptee)
            ->setModel($this->model);
    }
1106520
public function getAdapter()
    {
        if (is_null($this->_adapter)) {
            $key = "db_{$this->configName}";
            $this->setAdapter($this->getContainer()->get($key));
        }
        return $this->_adapter;
    }
382884
public function createIdentity(AdapterInterface $adapter): IdentityInterface
    {
        $map = new $this->attribute_map_class($adapter->getAttributeMap(), $this->logger);
        $this->identity = new $this->identity_class($adapter, $map, $this->logger);

        return $this->identity;
    }
498609
public function setAdapter(\Desarrolla2\Cache\Adapter\AdapterInterface $adapter)
    {
        return $this->_instance->setAdapter($adapter);
    }
931108
public function getWriteConnection(AdapterInterface $adapter = null)
    {
        if (null === $this->writeConnection) {
            $this->writeConnection = ConnectionFactory::create($this->writeConfiguration, $adapter);
            $this->writeConnection->setName($this->getName());
        }

        return $this->writeConnection;
    }
1257802
public function get($alias)
    {
        if (!array_key_exists($alias, $this->adapters)) {
            throw new \InvalidArgumentException(sprintf('There is no adapter registered under that alias: "%s"', $alias));
        }

        return $this->adapters[$alias];
    }
896206
public function get($key)
    {
        if (!isset($this->elements[$key])) {
            throw new InvalidArgumentException('Adapter does not exist');
        }

        return $this->elements[$key];
    }
1041447
private function getReadyAdapter(InputInterface $input, OutputInterface $output)
    {
        $adapterClass = $this->getAdapterClassFromArgument($input->getArgument('adapter'));

        try {
            $adapter = new $adapterClass();
        } catch (\Exception $e) {
            $adapterData = [];
            preg_match_all('/"(.*)"/i', $e->getMessage(), $matches);

            foreach ($matches[1] as $match) {
                $optionKey = str_replace('_', '-', Inflector::tableize($match));
                $option    = $input->getOption($optionKey);

                if (!$option) {
                    throw new AdapterException(
                        sprintf(
                            'The option "%s" is needed by %s adapter',
                            $optionKey,
                            $adapterClass
                        )
                    );
                }

                $adapterData[$match] = $option;
            }

            $adapter = new $adapterClass($adapterData);
        }

        return $adapter;
    }
603525
protected function createFlysystem(AdapterInterface $adapter, array $config)
    {
        if (class_exists('League\Flysystem\EventableFilesystem\EventableFilesystem')) {
            $fsClass = \League\Flysystem\EventableFilesystem\EventableFilesystem::class;
        } else {
            $fsClass = \League\Flysystem\Filesystem::class;
        }

        if (class_exists('League\Flysystem\Cached\CachedAdapter')) {
            $adapter = $this->decorateWithCachedAdapter($adapter, Arr::get($config, 'cache', []));
        }

        $config = Arr::only($config, ['visibility']);

        return new $fsClass($adapter, count($config) > 0 ? $config : null);
    }
774590
public function authenticate( AdapterInterface $adapter = null )
    {
        $result = parent::authenticate( $adapter );

        if ( $result->isValid() )
        {
            $this->identityRefreshed = true;
        }

        return $result;
    }
149620
public function getAdapters(array $adapters = []): array
    {
        if (empty($adapter)) {
            return $this->adapter;
        }
        $list = [];
        foreach ($adapter as $name) {
            if (!$this->hasAdapter($name)) {
                throw new Exception\AdapterNotFound('auth adapter '.$name.' is not registered');
            }
            $list[$name] = $this->adapter[$name];
        }

        return $list;
    }
597643
protected function getAdapter(AdapterInterface $client, array $config)
    {
        $file = array_get($config, 'file', 'flysystem.json');
        $ttl = array_get($config, 'ttl');

        return new Adapter($client, $file, $ttl);
    }
8867
public function with($original, $adapter = null)
    {
        $new = clone $this;
        $new->original = $original;
        $new->adapter = $adapter;

        if ($new->adapter === null) {
            foreach ($new->adapters as $each) {
                if ($each::check($original)) {
                    $new->adapter = $each;
                    break;
                }
            }
        }

        if ($new->adapter === null || !class_exists($new->adapter)) {
            throw new \InvalidArgumentException('No valid adapter found');
        }

        return $new;
    }
1158267
public function createDoctrineAdapter($adapterClass = null, $entityManagerName = null)
    {
        if (null == $adapterClass) {
            $adapterClass = 'Lexik\Bundle\CurrencyBundle\Adapter\DoctrineCurrencyAdapter';
        }
        $adapter = $this->create($adapterClass);

        $em = $this->doctrine->getManager($entityManagerName);
        $adapter->setManager($em);

        return $adapter;
    }
192205
public function getAdapter()
    {
        if (null === $this->adapter) {
            $this->setAdapter($this->config['adapter']);
        }

        return $this->adapter;
    }