/** * {@inheritDoc} * * @todo */ public function exchange(Money $money, $targetCurrency) { if (is_string($targetCurrency)) { $targetCurrency = Currency::create($targetCurrency); } $exchangeRate = 0; return $money->exchange($targetCurrency, $exchangeRate); }
/** * {@inheritDoc} */ public function setValue($value) { if ($this->isMultiple()) { if ($value instanceof \Traversable) { $value = ArrayUtils::iteratorToArray($value); } elseif (!$value) { return parent::setValue([]); } elseif (!is_array($value)) { $value = (array) $value; } return parent::setValue(array_map(Currency::class . '::create', $value)); } return parent::setValue(Currency::create($value)); }
/** * {@inheritDoc} */ public function current() { return Currency::create($this->getCodes()[$this->position]); }