get

Return a client by its name or null if no client exist for that name.

@param  string          $type
@param  string          $name
@return ClientInterface
329997
public function get($type, $name)
    {
        return isset($this->clients[$type][$name]) ? $this->clients[$type][$name] : null;
    }
426844
protected function resolveName(Name $name, $type) {
        $resolvedName = $this->nameContext->getResolvedName($name, $type);
        if (null !== $resolvedName) {
            $name->setAttribute('resolvedName', $resolvedName->toString());
        }
        return $name;
    }
536191
public function client(string $name = 'default') : BitcoinClient
    {
        if (! array_key_exists($name, $this->clients)) {
            $config = $this->getConfig($name);

            $this->clients[$name] = $this->make($config);
        }

        return $this->clients[$name];
    }
1200647
public static function getInterface($type)
    {
        if (array_key_exists($type, self::$interfaces)) {
            return self::$interfaces[$type];
        }

        return false;
    }
1133824
public function getType($name)
    {
        $map = $this->getTypeMap();
        return isset($map[$name]) ? $map[$name] : NULL;
    }
193450
protected function getStub($name, $type)
    {
        if (stripos($name, '.php') === false) {
            $name = $name . '.php';
        }

        return $this->filesystem->get($this->getStubsPath($type) . '/' . $name);
    }
186868
protected function ___getterSetterCheckAccess ($type, $name)
    {
        // Check for explicit definition
        if (isset($this->_getterSetterAccessMap)) {
            if (array_key_exists($name, $this->_getterSetterAccessMap)) {
                if (array_key_exists($type, $this->_getterSetterAccessMap[$name])) {
                    return $this->_getterSetterAccessMap[$name][$type];
                }
            }
        }

        // Check for default privilege setting
        $typeUcf = ucfirst($type);
        $defaultAccessPropertyName = "_getterSetterDefault{$typeUcf}Allow";
        if (isset($this->{$defaultAccessPropertyName})) {
            return $this->{$defaultAccessPropertyName};
        }

        // Otherwise return default sensible answer (write no, read yes)
        if ('read' == $type) {
            return true;
        } else {
            return false;
        }
    }
1094365
public function get($type)
    {
        if ($type === self::TYPE_MAILER) {
            $name = $this->configService->getValue('system_mailer');
        } elseif ($type === self::TYPE_DISPATCHER) {
            $name = $this->configService->getValue('system_dispatcher');
        } else {
            throw new \InvalidArgumentException('Provided type does not exist');
        }

        if (empty($name)) {
            return null;
        }

        return $this->connector->getConnection($name);
    }
719910
public function getControlByName($name, $type = null)
    {
        foreach ($this->controls as $control) {
            if ($type !== null) {
                if ($control instanceof $type && $control->getName() === $name) {
                    return $control;
                }
            } else {
                if ($control->getName() === $name) {
                    return $control;
                }
            }
        }

        return null;
    }
1309859
public function getItems($name, $type)
	{
		$namespaced = $this->namespace.':'.$name;

		$key = ($type === 'queued') ? $namespaced : $namespaced.':'.$type;

		if ( ! $this->exists($key)) throw new QueueNotFoundException($key);

		$type = $this->type($key);
		$length = $this->length($key, $type);

		$method = 'get'.ucwords($type).'Items';
		$items = $this->{$method}($key, $length);

		return Collection::make($items);
	}
704808
public static function input($name, $type = INPUT_SERVER)
    {
        //====================================================================//
        // Standard Safe Reading
        $result = filter_input($type, $name);
        if (null !== $result) {
            return $result;
        }
        //====================================================================//
        // Fallback Reading
        if ((INPUT_SERVER === $type) && isset($_SERVER[$name])) {
            return $_SERVER[$name];
        }
        if ((INPUT_GET === $type) && isset($_GET[$name])) {
            return $_GET[$name];
        }

        return null;
    }
798337
protected function getInterface($name) {
    if (isset($this->requiredInterfaces[$name])) {
      return $this->requiredInterfaces[$name];
    }
    return null;
  }
576557
public function isAdded($type, $name) {
        $widget = $this->getWidgetBoxManager()->findPublishedByTypeAndName($type, $name);
        return $widget;
    }
178904
public function &get($type, $name)
    {
        if ($this->_initialized) {
            $type = strtolower($type);
            if (false == key_exists($type, $this->types)) {
                return PEAR::raiseError("No such type $type");
            }

            $name     = strtolower($name);
            $type_var = &$this->{'_' . $this->types[$type]};

            if (key_exists($name, $type_var)) {
                return $type_var[$name];
            } elseif (key_exists($name, $this->_oids) && $this->_oids[$name]['type'] == $type) {
                return $this->_oids[$name];
            } else {
                return PEAR::raiseError("Could not find $type $name");
            }
        } else {
            $return = null;
            return $return;
        }
    }
385931
public function getClientByName(string $name): Client
    {
        if (!isset($this->clientsConfig[$name])) {
            throw new RuntimeException(sprintf('Contentful client with "%s" name does not exist.', $name));
        }

        return $this->clientsConfig[$name]['service'];
    }
521557
public static function findFirstByNameType( $name, $type, $config = [] ) {

		return self::queryByNameType( $name, $type, $config )->one();
	}
1289262
public function addParam($name, $type = null)
    {
        $this->params[(string)$name] = $type;
        return $this;
    }