public function getResource($name = null)
    {
        if (null === $name) {
            $name = $this->config->getResourceName();
        }
        if (isset($this->resources[$name])) {
            return $this->resources[$name];
        }
        return null;
    }