Posted by championX on December 22, 2012 at 10:01pm
I'm trying to make sense of something and understand what the code below means.
This is more of a basic general php question in drupal context. I'm a php noob but a long-time drupal user.
So basically an array is assigned to the $item variable. What's the 'uc_rules_order_state_update_line_item' for? Where are the values of the arguments being pulled from? I thought uc_order, uc_line_item and old_order_status are names of table in the database but I can't see them in the table?
$items['uc_rules_order_state_update_line_item'] = array(
'label' => t('Order state is updated - per order line'),
'arguments' => array(
'uc_order' => array(
'type' => 'uc_order',
'label' => t('Updated Order'),
),
'uc_line_item' => array(
'type' => 'uc_line_item',
'label' => t('Updated Order Line item'),
),
'old_order_status' => array(
'type' => 'string',
'label' => t('Old Order Status'),
),
'new_order_status' => array(
'type' => 'string',
'label' => t('New Order Status'),
),
),
'module' => 'Ubercart Rules',
);This bit is inside a function:
function function_name() {
//Code above goes here
return $items;
}
Comments
The function,in this case a
The function,in this case a ubercart hook, determines how the return value is interpreted and it used.