You are here

public function CommerceOrderEntityController::create in Commerce Core 7

Create a default order.

Parameters

array $values: An array of values to set, keyed by property name.

Return value

An order object with all default fields initialized.

Overrides DrupalCommerceEntityController::create

File

modules/order/includes/commerce_order.controller.inc, line 23
The controller for the order entity containing the CRUD operations.

Class

CommerceOrderEntityController
The controller class for orders contains methods for the order CRUD operations. The load method is inherited from the default controller.

Code

public function create(array $values = array()) {
  $values += array(
    'order_id' => NULL,
    'order_number' => NULL,
    'revision_id' => NULL,
    'uid' => '',
    'mail' => !empty($values['uid']) && ($account = user_load($values['uid'])) ? $account->mail : '',
    'data' => array(),
    'created' => '',
    'changed' => '',
    'placed' => '',
    'hostname' => '',
  );
  return parent::create($values);
}