Interface QuotePersistedHelper

All Superinterfaces:
LineItemHelper, QuoteHelper, Reviewable

public interface QuotePersistedHelper extends QuoteHelper
Extends QuoteHelper with operations that are only available when the persisted quote calculation processor is enabled on the QuoteType, i.e. when the line items live in the database rather than in the serialized quote.

The helper returned by quoteProcessor.getHelper() implements this interface only in that mode, so prefer the methods declared on QuoteHelper unless you specifically need the database to do the filtering.

See Also:
  • Method Details

    • getLineItemsIterator

      LineItemIterator getLineItemsIterator(Filter filter)
      Streaming iterator over the line items matching the given filter, evaluated by the database.

      This is the persisted-mode replacement for QuoteHelper.findAllWithSKU(String) and LineItemHelper.findAllWithLabel(String), both of which would have to load every line item into memory.

      Example:

      
       import com.googlecode.genericdao.search.Filter
      
       quoteProcessor.getHelper().getLineItemsIterator(Filter.equal("sku", "P123")).withCloseable { items ->
           items.each { item -> api.logInfo("Item", item.lineId) }
       }
       
      Parameters:
      filter - the filter to apply, or null for all line items of the quote
      Returns:
      an iterator over the matching line items; must be closed after use (try-with-resources or withCloseable)