You are here

function uc_file_get_download_limit in Ubercart 6.2

Same name and namespace in other branches
  1. 8.4 uc_file/uc_file.module \uc_file_get_download_limit()
  2. 7.3 uc_file/uc_file.module \uc_file_get_download_limit()

Gets the maximum number of downloads for a given file.

If there are no file-specific download limits set, the function returns the global limits. Otherwise the limits from the file are returned.

Parameters

$file: A uc_file_products object.

Return value

The maximum number of downloads.

3 calls to uc_file_get_download_limit()
uc_file_action_order_renew in uc_file/uc_file.ca.inc
Renews an orders product files.
uc_file_add_to_cart in uc_file/uc_file.module
Implements hook_add_to_cart().
uc_file_update_6005 in uc_file/uc_file.install
Iterate over all the existing file_user objects and replace them with the defaults for their product feature.
1 string reference to 'uc_file_get_download_limit'
uc_file_update_6005 in uc_file/uc_file.install
Iterate over all the existing file_user objects and replace them with the defaults for their product feature.

File

uc_file/uc_file.module, line 1791

Code

function uc_file_get_download_limit($file) {
  if (!isset($file->download_limit) || $file->download_limit == UC_FILE_LIMIT_SENTINEL) {
    return variable_get('uc_file_download_limit_number', NULL);
  }
  else {
    return $file->download_limit;
  }
}