public function getDb() {

		if(empty($this->db)) {

			if(empty($this->config->db)) {
				
				try {
					return $this->getVxPDO();
				}
				
				catch(ApplicationException $e) {
					return null;
				}
				
			}

			$config = $this->config->db;

			$this->db = DatabaseInterfaceFactory::create(
				isset($config->type) ? $config->type : 'mysql',
				[
					'host'		=> $config->host,
					'dbname'	=> $config->name,
					'user'		=> $config->user,
					'password'	=> $config->pass,
				]
			);
		}

		return $this->db;

	}