You are here

public function UcOrder::__construct in Ubercart 7.3

Same name and namespace in other branches
  1. 6.2 uc_order/uc_order.module \UcOrder::__construct()

Order object constructor.

Parameters

$uid: The user ID that owns the order, or a cart ID. Cart IDs are integer user IDs for authenticated users, or are strings of 22 characters or more for anonymous users.

$state: The initial order state.

File

uc_order/uc_order.module, line 68

Class

UcOrder
Defines an order object.

Code

public function __construct($uid = 0, $state = 'in_checkout') {
  if (strlen($uid) < 22 && $uid > 0) {
    $this->uid = $uid;
    if ($account = user_load($uid)) {
      $this->primary_email = $account->mail;
    }
  }
  $this->order_status = uc_order_state_default($state);
  $this->currency = variable_get('uc_currency_code', 'USD');
  $this->billing_country = variable_get('uc_store_country', 840);
  $this->delivery_country = variable_get('uc_store_country', 840);
  $this->created = REQUEST_TIME;
  $this->modified = REQUEST_TIME;
}