public function CommerceLineItemEntityController::create in Commerce Core 7
Create a default line item.
Parameters
array $values: An array of values to set, keyed by property name.
Return value
A line item object with all default fields initialized.
Overrides DrupalCommerceEntityController::create
File
- modules/
line_item/ includes/ commerce_line_item.controller.inc, line 23 - The controller for the line item entity containing the CRUD operations.
Class
- CommerceLineItemEntityController
- The controller class for line items contains methods for the line item CRUD operations. The load method is inherited from the default controller.
Code
public function create(array $values = array()) {
$values += array(
'line_item_id' => NULL,
'order_id' => 0,
'type' => '',
'line_item_label' => '',
'quantity' => 1,
'created' => '',
'changed' => '',
'data' => array(),
);
return parent::create($values);
}