// Use Collection instead of HydrateCollection in several places
This commit is contained in:
+8
-12
@@ -1316,15 +1316,13 @@ class OrderCore extends ObjectModel
|
||||
/**
|
||||
* This method allows to get all Order Payment for the current order
|
||||
* @since 1.5.0.1
|
||||
* @return array Collection of Order Payment
|
||||
* @return Collection of Order Payment
|
||||
*/
|
||||
public function getOrderPaymentCollection()
|
||||
{
|
||||
$order_payment = Db::getInstance()->ExecuteS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'order_payment`
|
||||
WHERE `id_order` = '.(int)$this->id);
|
||||
return ObjectModel::hydrateCollection('OrderPayment', $order_payment);
|
||||
$order_payments = new Collection('OrderPayment');
|
||||
$order_payments->where('id_order = '.(int)$this->id);
|
||||
return $order_payments;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1402,15 +1400,13 @@ class OrderCore extends ObjectModel
|
||||
*
|
||||
* Get all invoices for the current order
|
||||
* @since 1.5.0.1
|
||||
* @return array Collection of Order invoice
|
||||
* @return Collection of Order invoice
|
||||
*/
|
||||
public function getInvoicesCollection()
|
||||
{
|
||||
$invoices = Db::getInstance()->ExecuteS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'order_invoice`
|
||||
WHERE `id_order` = '.(int)$this->id);
|
||||
return ObjectModel::hydrateCollection('OrderInvoice', $invoices);
|
||||
$order_invoices = new Collection('OrderInvoice');
|
||||
$order_invoices->where('id_order = '.(int)$this->id);
|
||||
return $order_invoices;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -69,8 +69,10 @@ class OrderInvoiceCore extends ObjectModel
|
||||
protected $fieldsRequired = array('id_order', 'number');
|
||||
protected $fieldsValidate = array('id_order' => 'isUnsignedId', 'number' => 'isUnsignedId');
|
||||
|
||||
protected $table = 'order_invoice';
|
||||
protected $identifier = 'id_order_invoice';
|
||||
public static $definition = array(
|
||||
'table' => 'order_invoice',
|
||||
'identifier' => 'id_order_invoice',
|
||||
);
|
||||
|
||||
public function getFields()
|
||||
{
|
||||
|
||||
@@ -54,8 +54,10 @@ class OrderPaymentCore extends ObjectModel
|
||||
'card_holder' => 'isAnything'
|
||||
);
|
||||
|
||||
protected $table = 'order_payment';
|
||||
protected $identifier = 'id_order_payment';
|
||||
public static $definition = array(
|
||||
'table' => 'order_payment',
|
||||
'primary' => 'id_order_payment',
|
||||
);
|
||||
|
||||
public function getFields()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user