You are here

function commerce_file_get_download_limit in Commerce File 7.2

Returns the file's download limit.

Checks for a download limit variable and invokes a hook to allow other modules to set their own limits.

Parameters

$license: The license entity.

$file: The file entity

$account: The user to check for. Leave it to NULL to check for the current user.

Return value

$download_limit as an integer.

1 call to commerce_file_get_download_limit()
commerce_file_can_download in ./commerce_file.module
Returns whether the licensed file can be downloaded.

File

./commerce_file.module, line 484
Extends Commerce License with the ability to sell access to files.

Code

function commerce_file_get_download_limit($license, $file, $account) {
  $download_limit = variable_get('commerce_file_download_limit', 100);
  foreach (module_implements('commerce_file_get_download_limit') as $module) {
    $download_limit = module_invoke($module, 'commerce_file_get_download_limit', $license, $file, $account);
  }
  return $download_limit;
}