You are here

function commerce_license_duration_units in Commerce License 7

Returns all defined duration units.

Return value

An array of duration units, keyed by their unix timestamp values.

4 calls to commerce_license_duration_units()
commerce_license_duration_from_timestamp in ./commerce_license.module
Converts a unix timestamp to a duration with a unit (1 day, 2 weeks, etc).
commerce_license_field_formatter_view in ./commerce_license.module
Implements hook_field_formatter_view().
commerce_license_field_widget_form in ./commerce_license.module
Implements hook_field_widget_form().
commerce_license_renew_action_form in ./commerce_license.module
Configuration form for commerce_license_renew_action.

File

./commerce_license.module, line 1186
Provides a framework for selling access to local or remote resources.

Code

function commerce_license_duration_units() {
  return array(
    365 * 86400 => t('years'),
    30 * 86400 => t('months'),
    7 * 86400 => t('weeks'),
    86400 => t('days'),
    3600 => t('hours'),
    60 => t('minutes'),
  );
}