findologic / libflexport

FINDOLOGIC export toolkit for XML and CSV data export
MIT License
4 stars 5 forks source link

Allow setting of "all" prices #106

Closed TheKeymaster closed 5 years ago

TheKeymaster commented 5 years ago

Purpose

Right now you would need to go through all prices if you built them dynamically just to get the values and set them again like:

/** @var Price[] $prices */
foreach ($prices as $price) {
    foreach ($price->getValues() as $usergroup => $priceValue) {
        $this->xmlItem->addPrice($priceValue, $usergroup);
    }
}

Approach

Create method \FINDOLOGIC\Export\Data\Item::setAllPrices which allows setting an array of Prices. We already have methods for setAllOrdernumbers and setAllImages which allow easy setting of properties.

Open Questions and Pre-Merge TODOs