You are here

function uc_order_state_data in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_order/uc_order.module \uc_order_state_data()
  2. 7.3 uc_order/uc_order.module \uc_order_state_data()

Return a bit of data from a state array based on the state ID and array key.

Parameters

$state_id: The ID of the order state you want to get data from.

$key: The key in the state array whose value you want: id, title, weight, scope.

Return value

The value of the key you specify.

1 call to uc_order_state_data()
uc_order_workflow_form in uc_order/uc_order.module

File

uc_order/uc_order.module, line 3032

Code

function uc_order_state_data($state_id, $key) {
  static $states;
  if (empty($states)) {
    $data = uc_order_state_list();
    foreach ($data as $state) {
      $states[$state['id']] = $state;
    }
  }
  return $states[$state_id][$key];
}