function hosting_quota_get in Hosting 7.3
Same name and namespace in other branches
- 6.2 quota/hosting_quota.module \hosting_quota_get()
- 7.4 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
array|bool 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 - @todo Please document this function.
- hosting_quota_resource_render in quota/
hosting_quota.module - Rendering function for quotas
File
- quota/
hosting_quota.module, line 81 - 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;
}
}