function uc_order_create in Ubercart 7.3
Same name and namespace in other branches
- 5 uc_order/uc_order.module \uc_order_create()
- 6.2 uc_order/uc_order.admin.inc \uc_order_create()
Entity API "creation callback" for uc_order entity.
Parameters
$values: A set of default values for the order.
1 string reference to 'uc_order_create'
- uc_order_entity_info in uc_order/
uc_order.module - Implements hook_entity_info().
File
- uc_order/
uc_order.module, line 950
Code
function uc_order_create($values, $entity_type) {
$order = new UcOrder();
foreach ($values as $key => $value) {
$order->{$key} = $value;
}
module_invoke_all('entity_presave', $order, 'uc_order');
drupal_write_record('uc_orders', $order);
uc_order_module_invoke('new', $order, NULL);
module_invoke_all('entity_insert', $order, 'uc_order');
return $order;
}