You are here

function hosting_quota_get in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 quota/hosting_quota.module \hosting_quota_get()
  2. 7.3 quota/hosting_quota.module \hosting_quota_get()

Get info about hosting quotas

We call here every declaration of hook_hosting_quota_resource

Parameters

$resource string: The name of the requested resource

Return value

A multidimensional array containing the resource, or false if the provided resource does not validate

3 calls to hosting_quota_get()
hosting_quota_check in quota/hosting_quota.module
Quickly check if a given quota has been exceeded
hosting_quota_get_usage in quota/hosting_quota.module
Get the usage for the specified resource
hosting_quota_resource_render in quota/hosting_quota.module
Rendering function for quotas

File

quota/hosting_quota.module, line 59
Implement quota's for the resource used by client.

Code

function hosting_quota_get($resource) {
  $all_resources = module_invoke_all('hosting_quota_resource');
  if (in_array($resource, array_keys($all_resources))) {
    return $all_resources[$resource];
  }
  else {

    // $resource is not valid, so generate an error
    watchdog('hosting_quota', 'Invalid resource called', array(), WATCHDOG_ERROR);
    return FALSE;
  }
}