private function getClass($key)
    {
        if (!array_key_exists($key, $this->config['classes'])) {
            throw new \InvalidArgumentException(sprintf('Undefined resource class "%s".', $key));
        }

        return $this->config['classes'][$key];
    }