/**
  * Create a quantity results model with the provided quantity models,
  * sku quantity data from the provided items and an expiration time based
  * on the current time offset by the configured quantity cache lifetime.
  *
  * @param EbayEnterprise_Inventory_Model_Quantity[]
  * @param Mage_Sales_Model_Quote_Item_Abstract[]
  * @return EbayEnterprise_Inventory_Model_Quantity_Result
  */
 public function createQuantityResults(array $quantityResults, array $requestedItems)
 {
     return Mage::getModel('ebayenterprise_inventory/quantity_results', ['quantities' => $quantityResults, 'expiration_time' => $this->_getQuantityExpirationTime(new DateTime()), 'sku_quantity_data' => $this->_quantityHelper->calculateTotalQuantitiesBySku($requestedItems)]);
 }
 /**
  * Get existing quantity results from the session. Will only return results
  * if they are valid and apply to the current state of the provided items.
  *
  * @param Mage_Sales_Model_Quote_Item[]
  * @return EbayEnterprise_Inventory_Model_Quantity_Restults|null
  */
 protected function _getSessionResults(array $items)
 {
     $results = $this->_getInventorySession()->getQuantityResults();
     $skuQuantityData = $this->_quantityHelper->calculateTotalQuantitiesBySku($items);
     return $results && $results->checkResultsApplyToItems($skuQuantityData) ? $this->_getInventorySession()->getQuantityResults() : null;
 }