On gists
Money price object
AW
demo.php
Raw
#
<?php
//App\PriceModule\Model\Currency $currency
// Money\Money $amount
// vytvoreni money objektu
$amountFrom = $this->currency->convertPrice(
$this->currency->parsePrice($activeRow->currency_id, $activeRow->amount_from)
);
// vetsi nebo rovno
$amount->greaterThanOrEqual($amountFrom)
// odecteni
/** @var \Money\Money */
$priceAfterDiscount = $price->getPrice()->subtract($discount)->getAmount();
// nastaveni objektu ceny
$price->setPrice($priceAfterDiscount)
// raw data jako string vcetne haliru napr 50000 // 500kc
/** @var \Money\Money */
$moneyObject->getAmount()