Returns the TeamSpeak3_Node_Channel object matching the given name.

@param  integer $name
@throws Exception
@return Channel
507287
public function subChannelGetByName($name)
  {
    foreach($this->subChannelList() as $channel)
    {
      if($channel["channel_name"] == $name) return $channel;
    }

    throw new Exception("invalid channelID", 0x300);
  }
513106
public function routeByName(?string $name) : ?string
    {
        if (is_null($name)) {
            throw ConfigurationException::create("Can't send via name using EventBus without " . EventBus::CHANNEL_NAME_BY_NAME . " header defined");
        }

        if (!array_key_exists($name, $this->availableChannelNames)) {
            return null;
        }

        return $name;
    }
1038462
public function getAdapter(string $name): ShellAdapterInterface
    {
        if (!array_key_exists($name, $this->shellAdapters)) {
            throw new Exception\DomainException("Shell adapter \"$name\" not found.");
        }

        return clone $this->shellAdapters[$name];
    }
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'];
    }
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];
    }
910157
protected function getFilter($name)
    {
        // filters must exists in configured filters
        if (!array_key_exists($name, $this->filters)) {
            throw new Exception('Invalid filter '.$name.'. Check your mapping configuration');
        }

        return $this->filters[$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));
    }
1104366
protected static function getAdapterName($name, $namespace = 'TeamSpeak3/Adapter')
  {
    $path = self::getFilePath($namespace);
    $scan = scandir($path);

    foreach($scan as $node)
    {
      $file = Str::factory($node)->toLower();

      if ($file->startsWith($name) && $file->endsWith(".php")) {
        return str_replace('.php', '', "Adams\\TeamSpeak3\\Adapter\\" . $node);
      }
    }

    throw new AdapterException("adapter '" . $name . "' does not exist");
  }
9869
public function serverGetByName($name)
  {
    foreach($this->serverList() as $server)
    {
      if($server["virtualserver_name"] == $name) return $server;
    }

    throw new Exception("invalid serverID", 0x400);
  }
1047158
function getEvent(string $name) {
        if(isset($this->wsevents[$name])) {
            return $this->wsevents[$name];
        }
        
        throw new \Exception('Unable to find WS event');
    }
356555
public function get($name)
    {
        // get from cache
        if (isset($this->pool[$name])) {
            return $this->pool[$name];
        }
        
        // check if connection exists
        if (!isset($this->configuration[$name])) {
            throw new Exception('Connection with name ' . $name . ' not found');
        }
        
        // check if dsn exists
        if (!isset($this->configuration[$name]['dsn'])) {
            $this->configuration[$name]['dsn'] = null;
        }
        
        // check if connect options exists
        if (empty($this->configuration[$name]['connectOptions'])) {
            $this->configuration[$name]['connectOptions'] = null;
        }
        
        // init client
        $client = new Client(
            $this->configuration[$name]['dsn'],
            $this->configuration[$name]['connectOptions']
        );
        
        if (isset($this->configuration[$name]['mapping'])) {
            $client->map($this->configuration[$name]['mapping']);
        }
        
        if (isset($this->configuration[$name]['defaultDatabase'])) {
            $client->useDatabase($this->configuration[$name]['defaultDatabase']);
        }
        
        $this->pool[$name] = $client;
        
        return $client;
    }
140331
public function getHelper($name) {
        if ( !$this->helperExist($name) ) {
            throw new \Exception(sprintf('El Helper (%s) solicitado no fue cargado.', $name));
        }
        $helper = $this->_container[$name];
        $helper->configure([]);
        return $helper;
    }
1201954
public function create($name)
    {
        $response = giga_facebook_post('me/custom_labels', compact('name'));

        if (isset($response->error)) {
            $message = isset($response->error->error_user_msg) ? $response->error->error_user_msg : $response->message;
            throw new \Exception($message);
        }

        if (isset($response->id)) {
            return $response->id;
        }
    }
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.'
            );
        }
    }
334403
public function getReceiver(string $name)
    {
        $classPath = explode('\\', get_called_class());
        $class     = (string)$this->getApi()
                                  ->sprintf(':namespace\:class\:method', __NAMESPACE__, end($classPath), $name);

        if (class_exists($class)) {
            return new $class($this);
        }

        return null;
    }
760115
public function get($name)
    {
        if ($this->has($name)) {
            return $this->data[$name];
        }
        // possible performance bottleneck, convert to iterative if necessary
        if ($this->parent) {
            return $this->parent->get($name);
        }
        throw new HTMLPurifier_Exception("Key '$name' not found");
    }
1368933
protected function getPDO($name)
    {
        if (!isset($this->config[$name]) || !is_array($this->config[$name])) {
            throw new \Exception('Config not found ! (config: ' . $name . ')');
        }

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

        if (!isset($config['dsn'])) {
            throw new \Exception('"dsn" parameter is not defined !');
        }

        if (!isset($config['user'])) {
            throw new \Exception('"user" parameter is not defined !');
        }

        if (!isset($config['pass'])) {
            throw new \Exception('"pass" parameter is not defined !');
        }

        $config['options'] = isset($config['options']) ? $config['options'] : array();

        $options = array();
        foreach ($config['options'] as $name => $value) {
            if (0 === strpos($name, 'PDO::')) {
                $options[constant($name)] = $value;
            }
        }

        $connection = new \PDO($config['dsn'], $config['user'], $config['pass'], $options);
        $connection->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);

        return $connection;
    }