We will soon have pricing and payment APIs that require price values as arguments.
The problem with the object used for entity fields is that it can't be instantiated standalone, which means people can't pass their own amounts without creating an entity first, and then using that entity's field item. That's clunky. Instead, let's introduce a value object for this purpose.

Plan:
- Rename Price to PriceItem (matches core conventions)
- Add a Price value object (no interface, getDecimalAmount, getCurrencyCode)
- Add PriceItem::toPrice(), and allow setValue() to accept the price.

Comments

bojanz created an issue. See original summary.

  • bojanz committed 7780111 on 8.x-2.x
    Issue #2749269 by bojanz: Add a price value object, connect it to the...
bojanz’s picture

Status: Active » Fixed

Done.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.