Returns the first Server object matching the given name.

@param  string $name
@throws Exception
@return Server
9869
public function serverGetByName($name)
  {
    foreach($this->serverList() as $server)
    {
      if($server["virtualserver_name"] == $name) return $server;
    }

    throw new Exception("invalid serverID", 0x400);
  }
677804
public static function get($name) 
		{
			if (array_key_exists($name, self::$_auths)) {
				return self::$_auths[$name];
			} else {
				throw new \Exception("There is no Auth defined for '$name'.", 1);				
			}
		}
514225
public function get($name)
    {
        if (isset($this->instances[$name])) {
            return $this->instances[$name];
        }
        if (! isset($this->registry[$name])) {
            $exceptionClass = static::NOT_FOUND_EXCEPTION;
            throw new $exceptionClass(
                sprintf(static::NOT_FOUND_MESSAGE, $name)
            );
        }
        try {
            $this->instances[$name] = $this->build($this->registry[$name], $name);
        } catch (Exception $e) {
            throw new RuntimeException(
                sprintf(static::BUILD_FAILURE_MESSAGE, $name),
                null,
                $e
            );
        }

        return $this->instances[$name];
    }
119258
public function getMenu(string $name): Menu
    {
        if (!$this->hasMenu($name)) {
            throw new Exception('Invalid menu name "'.$name.'"');
        }

        return $this->menus[$name];
    }
318352
public function findByName($name)
    {
        if (is_null($name)) {
            throw new \Exception('name is required');
        }
        $role = $this->getRepository('\erdiko\users\entities\Role');

        return $role->findOneBy(array('name' => $name));
    }
396595
public function getRawHeader($name)
    {
        $name = strtolower($name);
        if (isset($this->parts[1])) {
            $headers = $this->getPart('headers', $this->parts[1]);

            return isset($headers[$name]) ? $headers[$name] : false;
        } else {
            throw new Exception(
                'setPath() or setText() or setStream() must be called before retrieving email headers.'
            );
        }
    }
628224
private function _controllerFor($name)
	{
		if(isset($this->_controllers[$name]) && is_string($this->_controllers[$name]))
		{
			return $this->_controllerFor($this->_controllers[$name]);
		}
		else if(isset($this->_controllers[$name]) && is_object($this->_controllers[$name]))
		{
			return $this->_controllers[$name];
		}
		else if(isset($this->_controllerFactory))
		{
			return $this->_controllerFactory->resolve($name);
		}
		else
		{
			throw new Exception("No controller found for $name");
		}
	}
376051
public function getFirst($name)
    {
        $names = func_get_args();

        foreach ($names as $name) {
            if (isset($this->data[$name])) {
                return $this->data[$name];
            }
        }
    }
48059
private function getProfile($name)
    {
        $profiles = $this->container->getParameter('profiles');
        if (!array_key_exists($name, $profiles)) {
            throw new \Exception(
                sprintf(
                    'There is no profile with the name \'%s\', expecting: (%s)',
                    $name,
                    implode(', ', array_keys($profiles))
                )
            );
        }

        return $profiles[$name];
    }
542092
public function getItem(string $name)
    {
        if (isset($this->__delayItems[$name])) {

            return $this->__delayItems[$name];
        }

        if (!is_callable($this->__delayCtors[$name] ?? false)) {

            throw new Exception(
                "Item {$name} not found.",
                Exception::ITEM_NOT_FOUND
            );
        }

        return $this->__delayItems[$name] = $this->__delayCtors[$name](
            ...$this->__delayCtorArgs
        );
    }
438640
public function getItem($name)
    {
        $items = $this->getItems();
        if ( ! $this->hasItem($name)) {
            throw new Exception(
                'Bad Item [' . $name . '] for smart property 
                [' . $this->getManager()->getController() . '][' . $this->getName() . ']');
        }

        return $items[$name];
    }
1268169
public function getServer(string $name = null)
    {
        if (is_null($name)) {
            return $this->get('server');
        }

        return $this->get('server', $name);
    }
1325409
public function get(string $name): Projection {
        return $this->projections->filter(function (Projection $projection) use ($name) {
            return $projection->name() === $name;
        })->first();
    }
850623
public function getTemplate($name)
    {
        if (!array_key_exists($name, $this->getTemplates())) {
            throw new \Exception('Template not found');
        }

        return $this->getTemplates()[$name];
    }
507287
public function subChannelGetByName($name)
  {
    foreach($this->subChannelList() as $channel)
    {
      if($channel["channel_name"] == $name) return $channel;
    }

    throw new Exception("invalid channelID", 0x300);
  }
134054
public function unregister($name)
    {
        if (!isset($this->registry[$name])) {
            throw new Exception('Object with name "'.$name.'" is not registered');
        }

        $object = $this->registry[$name];
        unset($this->registry[$name]);

        return $object;
    }
1105836
public function selectDatabase($name)
    {
        $response = $this->client->request('GET', sprintf('/%s/', $name));

        if (404 === $response->getStatusCode()) {
            throw new Exception(sprintf('The database "%s" does not exist', $name));
        }

        return $this->wrapDatabase($name);
    }