/** * Returns account used space in Kb. * * @param string $sEmail Email address associated with the account. * * @return int */ public function getAccountUsedSpace($sEmail) { $iResult = 0; if ($this->oConnection->Execute($this->oCommandCreator->getAccountUsedSpaceQuery($sEmail))) { $oRow = $this->oConnection->GetNextRecord(); if ($oRow) { $sQuotaUsageBytes = (string) $oRow->main_usage; if (0 < strlen($sQuotaUsageBytes) && is_numeric($sQuotaUsageBytes)) { $iResult = (int) ($sQuotaUsageBytes / 1024); } } $this->oConnection->FreeResult(); } return $iResult; }
/** * Returns query-string for obtaining account used space in Kb. * * @param string $sEmail Email address associated with the account. * * @return string */ public function getAccountUsedSpaceQuery($sEmail) { return parent::getAccountUsedSpaceQuery($sEmail) . ' LIMIT 1'; }