<?php

/**
 * Provides a global endpoint for access to Zend_Cache
 *
 * @package Atmail
 * @subpackage Quota
 * @copyright Copyright (C) 2011 Atmail. All rights reserved.
 * @author Atmail
 */
class Atmail_Quota_Db extends Atmail_Quota
{
	public function _getUsedQuota()
	{
		throw new Exception(__METHOD__ . ": NOT IMPLEMENTED");
		return false;
	}

	public function _getTotalQuota()
	{
		$dbAdapter = Zend_Registry::get('dbAdapter');
		// Find the original users disk quota
		$quota = $dbAdapter->fetchOne("select UserQuota from Users where Account=" . $dbAdapter->quote($this->configuration[Atmail_Quota::ACCOUNT]));

		self::log(__METHOD__ . ": Quota = " . $quota);
		return $quota;
	}
}
