Short description of method getAdapter

@access public
@author Somsack Sipasseuth, <somsack.sipasseuth@tudor.lu>
@param  type
@return tao_helpers_transfert_Adapter
432154
public function getAdapter($type)
    {
        $returnValue = null;

        
		foreach($this->adapters as $adapter){
			if($adapter instanceof $type){
				$returnValue = $adapter;
				break;
			}
		}
        

        return $returnValue;
    }
339444
public function getAdminAdapter() {
		if ($this->adminAdapter === null) {
			$this->adminAdapter = $this->adapterFactory->createAdminAdapter($this);
		}
		return $this->adminAdapter;
	}
258603
public boolean canAdapt(Object input, Class<?> outputType) {
		Class<?> inputType = input.getClass();
		Adapter a = findAdapter(input, inputType, outputType);
		return a != null;
	}
1036209
protected static <AdapterType> AdapterType getAdapter(Resource resource, Class<AdapterType> type) {
        if (type == ResourceHandle.class) {
            return type.cast(new ResourceHandle(resource));
        }
        log.info("Unable to adapt resource on {} to type {}", resource.getPath(), type.getName());
        return null;
    }
571632
public function getAdapterType()
  {
    if($this->adapter instanceof Adapter)
    {
      $string = Str::factory(get_class($this->adapter));

      return $string->substr($string->findLast("_"))->replace(array("_", " "), "")->toString();
    }

    return "Unknown";
  }
584870
public static <E extends PreferenceTypeAdapter<?, ?>> E getAdapter(Class<E> clazz) {
		@SuppressWarnings("unchecked")
		E adapter = (E) cache.get(clazz);

		if (adapter == null) {
			adapter = generateAdapter(clazz);
		}

		return adapter;
	}
973126
public function getAdapter()
    {
        /**
         * Check for an adapter being defined. if not, fetch the default adapter.
         */
        if ($this->_adapter === null) {
            $this->_adapter = Zend_Db_Table_Abstract::getDefaultAdapter();
            if (null === $this->_adapter) {

                throw new Zend_Validate_Exception('No database adapter present');
            }
        }
        return $this->_adapter;
    }
662631
public <T> Provider<T> getCurrentInstanceProvider(Class<T> type) {
		return getCurrentInstanceProvider(Key.get(type));
	}
263272
@SuppressWarnings("unchecked")
	public <Input,Output> Adapter<Input,Output> findAdapter(Object in, Class<Input> input, Class<Output> output) {
		ArrayList<Adapter> acceptInput = new ArrayList<>();
		ArrayList<Adapter> matching = new ArrayList<>();
		for (Adapter a : adapters) {
			if (!a.getInputType().isAssignableFrom(input)) continue;
			if (!a.canAdapt(in)) continue;
			acceptInput.add(a);
			if (output.equals(a.getOutputType()))
				return a;
			if (output.isAssignableFrom(a.getOutputType()))
				matching.add(a);
		}
		if (acceptInput.isEmpty())
			return null;
		if (matching.size() == 1)
			return matching.get(0);
		if (!matching.isEmpty())
			return getBest(matching);
		LinkedList<LinkedList<Adapter>> paths = findPathsTo(input, acceptInput, output);
		LinkedList<Adapter> best = null;
		while (!paths.isEmpty()) {
			LinkedList<Adapter> path = paths.removeFirst();
			if (best != null && best.size() <= path.size()) continue;
			Object o = in;
			boolean valid = true;
			int i = 0;
			for (Adapter a : path) {
				if (!a.canAdapt(o)) {
					valid = false;
					break;
				}
				if (i == path.size() - 1)
					break; // we are on the last, so no need to do it
				i++;
				try {
					o = a.adapt(o);
				} catch (Exception e) {
					valid = false;
					break;
				}
			}
			if (valid)
				best = path;
		}
		if (best == null) return null;
		return new LinkedAdapter(best);
	}
1255611
public PriorityConverter getConverter(Type type) {
        PriorityConverter converter = converters.get(type);
        return converter;
    }
1029531
public function getAdapter()
    {

        if (!isset($this->adapter)) {

            $adapter = $this->options['adapter'];
            $className = strpos($adapter, '\\') === false
                ? __NAMESPACE__.'\\Renderer\\Adapter\\'.ucfirst($this->options['adapter'])
                : $adapter;

            if (!class_exists($className))
                throw new \RuntimeException(
                    "The passed adapter $className doesn't exist"
                );

            if (!is_subclass_of($className, __NAMESPACE__.'\\Renderer\\AdapterBase'))
                throw new \RuntimeException(
                    "The passed adapter $className doesn't extend Tale\\Jade\\Renderer\\AdapterBase"
                );

            $this->adapter = new $className($this, $this->options['adapter_options']);
        }

        return $this->adapter;
    }
1144111
public function getAuthenticationAdapter()
    {
        if (null === $this->authenticationAdapter) {
            $authenticationAdapter = $this->getAuthenticationService()->getAdapter();
            $this->setAuthenticationAdapter($authenticationAdapter);
        }

        return $this->authenticationAdapter;
    }
236069
public function hasAdapter($type = '')
    {
        $returnValue = (bool) false;

        
		$adapterClass = empty($type)?'tao_helpers_grid_Cell_Adapter':$type;
		foreach($this->adapters as $adapter){
			if($adapter instanceof $adapterClass){
				$returnValue = true;
				break;
			}
		}
		
        

        return (bool) $returnValue;
    }
978284
private function getDefaultAdapter()
    {
        if (extension_loaded('curl')) {
            $this->parallelAdapter = new MultiAdapter($this->messageFactory);
            $this->adapter = function_exists('curl_reset')
                ? new CurlAdapter($this->messageFactory)
                : $this->parallelAdapter;
            if (ini_get('allow_url_fopen')) {
                $this->adapter = new StreamingProxyAdapter(
                    $this->adapter,
                    new StreamAdapter($this->messageFactory)
                );
            }
        } elseif (ini_get('allow_url_fopen')) {
            $this->adapter = new StreamAdapter($this->messageFactory);
        } else {
            throw new \RuntimeException('Guzzle requires cURL, the '
                . 'allow_url_fopen ini setting, or a custom HTTP adapter.');
        }
    }
51952
public static Converter converterFor( Class type )
    {
        if (!converters.containsKey( type ))
            throw new IllegalArgumentException( "Don't know type: " + type );

        return converters.get( type );
    }
264596
public static function getAdapter(string $adapter = null): AbstractCacheAdapter
    {
        $key = $adapter ?? static::getConfig()->getFirstKey();

        if (isset(static::$adapters[$key])) {
            return static::$adapters[$key];
        }

        $config = static::getConfig();
        $configArray = $config->get($key, []);

        if (($configArray['enabled'] ?? false) === false) {
            static::$adapters[$key] = new Cache\Adapter\DevNull([]);
        } else {

            if (isset($configArray['module'])) {
                Application::registerModule($configArray['module']);
            }

            $className = $configArray['adapter_class'] ?? null;

            if ($className === null) {
                throw new ConfigException("Cache config under key={$key} doesn\'t have defined 'adapter_class'; please set the 'adapter_class' with the name of class that extends \\Koldy\\Cache\\Adapter\\AbstractCacheAdapter");
            }

            if (!class_exists($className, true)) {
                throw new ConfigException("Class={$className} defined in cache config under key={$adapter} wasn't found; check the name and namespace of class and if class can be loaded");
            }

            static::$adapters[$key] = new $className($configArray['options'] ?? []);
        }

        return static::$adapters[$key];
    }
780748
private function getAccessControlProvider($type)
    {
        foreach ($this->accessControlProviders as $accessControlProvider) {
            if ($accessControlProvider->supports($type)) {
                return $accessControlProvider;
            }
        }
    }