You are here

function commerce_file_license_states in Commerce File 7

Returns an array of all the license states keyed by name.

License states can only be defined by modules. When this function is first called, it will load all the states as defined by hook_commerce_file_license_state_info(). The final array will be cached for subsequent calls.

Return value

The array of state objects, keyed by state name.

2 calls to commerce_file_license_states()
commerce_file_license_state_get_title in includes/
Returns the human readable title of any or all states.
commerce_file_license_state_load in includes/
Returns a state object.


includes/, line 376
Handles file licenses and file license logs


function commerce_file_license_states() {

  // First check the static cache for a states array.
  $states =& drupal_static(__FUNCTION__);

  // If it did not exist, fetch the states now.
  if (!isset($states)) {
    $states = module_invoke_all('commerce_file_license_state_info');

    // Give other modules a chance to alter the states.
    drupal_alter('commerce_file_license_state_info', $states);
    uasort($states, 'drupal_sort_weight');
  return $states;