I am a bit confused about a function:
public function requestShippingRates(Mage_Sales_Model_Quote_Item_Abstract $item)
{
/** @var $request Mage_Shipping_Model_Rate_Request */
$request = Mage::getModel('shipping/rate_request');
$request->setAllItems($item ? array($item) : $this->getAllItems());
}
I know that $item
is an arrangement, but what is this Mage_Sales_Model_Quote_Item_Abstract
?
For Type Hinting see the reference
As stated in an example on the referenced Page:
<?php
class C {}
class D extends C {}
// This doesn't extend C.
class E {}
function f(C $c) {
echo get_class($c)."
";
}
f(new C);//C
f(new D);//D
f(new E);//throws exception
?>
The reason Magento is doing this is because you can use one method for both getting the shipping rate for one or all shipping items (when passing invalid data).