Set the adapter

@param   \Library\Reporter\AbstractAdapter $adapter The instance of a ReporterAdapter
@return  self
@throws  \LogicException
342069
public function setAdapter(AbstractAdapter $adapter)
    {
        $cls = get_class($adapter);
        foreach(self::$default_masks as $_mask) {
            if (null===@constant($cls.'::mask_'.$_mask)) {
                throw new \LogicException(
                    sprintf('Reporter adapter "%s" must define a mask named "%s"!', $cls, $_mask)
                );
            }
        }
        $this->__adapter = $adapter;
        return $this;
    }
530703
protected function _setAdapter(array $options)
    {
        $adapterFactory = AdapterFactory::instance();
        $connection     = new Connection($this->_connectionConfig->getArrayCopy());
        $adapter        = $adapterFactory->getAdapter($this->_adapterName, $options);

        return new CakeAdapter($adapter, $connection);
    }
848428
public function set(array $adapters, CacheableInterface $item)
    {
        foreach ($adapters as $adapter) {
            $adapter->set($item);
        }
    }
711792
protected function setCurlProxyOptions($adapter)
    {
        $adapter->setCurlOption(CURLOPT_PROXY, $this->proxyConfig['proxy_host']);
        if (!empty($this->proxyConfig['proxy_port'])) {
            $adapter
                ->setCurlOption(CURLOPT_PROXYPORT, $this->proxyConfig['proxy_port']);
        }
    }
740367
public function setAdapter($adapter, $options = null)
    {
        $adapter = ucfirst(strtolower($adapter));

        if (Zend_Loader::isReadable('Zend/Validate/Barcode/' . $adapter. '.php')) {
            $adapter = 'Zend_Validate_Barcode_' . $adapter;
        }

        if (!class_exists($adapter)) {
            Zend_Loader::loadClass($adapter);
        }

        $this->_adapter = new $adapter($options);
        if (!$this->_adapter instanceof Zend_Validate_Barcode_AdapterInterface) {

            throw new Zend_Validate_Exception(
                "Adapter " . $adapter . " does not implement Zend_Validate_Barcode_AdapterInterface"
            );
        }

        return $this;
    }
621113
public function injectAdapter(AdapterInterface $adapter, ?string $name = null): self
    {
        if (null === $name) {
            $name = get_class($adapter);
        }

        $this->logger->debug('inject auth adapter ['.$name.'] of type ['.get_class($adapter).']', [
            'category' => get_class($this),
        ]);

        if ($this->hasAdapter($name)) {
            throw new Exception\AdapterNotUnique('auth adapter '.$name.' is already registered');
        }

        $this->adapter[$name] = $adapter;

        return $this;
    }
130634
public function setAdapter($alias, AdapterInterface $adapter)
    {
        $this->adapters->set($alias, $adapter);
        return $this;
    }
398855
public final void setAdapter(@Nullable final ExpandableListAdapter adapter) {
        expandedGroups.clear();

        if (adapter != null) {
            this.adapter = new AdapterWrapper(adapter);
            super.setAdapter(this.adapter);
        } else {
            this.adapter = null;
            super.setAdapter(null);
        }
    }
635846
public function setTransformer($transformer = null)
    {
        if (!$this->resource) {
            throw new MissingResourceException('Resource must be specified before setting a transformer');
        }
        $this->resource->setTransformer($transformer);

        return $this;
    }
307448
public function setAdapter(AdapterInterface $adapter)
    {
        $this->adapter = $adapter;
        $this->connection = new Connection($this->adapter);
    }
49292
public static function gaufretteFactory(array $adapter) {
		$class = $adapter['adapterClass'];
		$Reflection = new ReflectionClass($class);

		if (!is_array($adapter['adapterOptions'])) {
			throw new InvalidArgumentException(sprintf('%s: The adapter options must be an array!', $configName));
		}

		$adapterObject = $Reflection->newInstanceArgs($adapter['adapterOptions']);

		return new $adapter['class']($adapterObject);
	}
508494
public function adapter($adapter = null)
    {
        if ($adapter === null) {
            return $this->_adapter;
        }

        $this->_adapter = $adapter;
    }
401734
static public function isAvailableAdapter($adapter)
    {
        $adapter = strtolower($adapter);
        $result  = false;
        $type    = null;

        $pdoAdapters = (class_exists('Pdo', false)) ? \PDO::getAvailableDrivers() : array();
        if (strpos($adapter, 'pdo_') !== false) {
            $type    = substr($adapter, 4);
            $adapter = 'pdo';
        }

        switch ($adapter) {
            case 'mysql':
            case 'mysqli':
                $result = (class_exists('mysqli', false));
                break;
            case 'oci':
            case 'oracle':
                $result = (function_exists('oci_connect'));
                break;
            case 'pdo':
                $result = (in_array($type, $pdoAdapters));
                break;
            case 'pgsql':
                $result = (function_exists('pg_connect'));
                break;
            case 'sqlite':
                $result = (class_exists('Sqlite3', false));
                break;
            case 'sqlsrv':
                $result = (function_exists('sqlsrv_connect'));
                break;
        }

        return $result;
    }
230410
public function attach(AdapterInterface $adapter, $priority = self::DEFAULT_PRIORITY)
    {
        $this->adapters->insert($adapter, $priority);

        return $this;
    }
1294119
public function setLogger(LoggerInterface $logger)
    {
        foreach ($this->adapters as $adapter) {
            if ($adapter instanceof LoggerAwareInterface) {
                $adapter->setLogger($logger);
            }
        }
        $this->logger = $logger;
    }
913049
public function setAdapter($adapterOrSqlObject)
    {
        if ($adapterOrSqlObject instanceof \Zend\Db\Sql\Sql) {
            $this->sqlObject = $adapterOrSqlObject;
        } elseif ($adapterOrSqlObject instanceof \Zend\Db\Adapter\Adapter) {
            $this->sqlObject = new \Zend\Db\Sql\Sql($adapterOrSqlObject);
        } else {
            throw new \InvalidArgumentException('Object of "Zend\Db\Sql\Sql" or "Zend\Db\Adapter\Adapter" needed.');
        }
    }
784200
public function setAdapterAction($action)
    {
        if (true===$this->isInited) {
            $this->resetOutput();
        }
        $this->__adapter_action = $action;
        return $this;
    }