/** * * * @throws Exception\InvalidArgumentException * @param string|RowColumn $unit * @return UnitFormatter */ public function setUnit($unit) { if ($unit instanceof RowColumn) { $this->unit_column = $unit->getColumnName(); } elseif (!is_string($unit) || trim($unit) == '') { throw new Exception\InvalidArgumentException(__METHOD__ . " Unit must be an non empty string (or a RowColumn object)"); } $this->params['unit'] = $unit; return $this; }
/** * The 3-letter ISO 4217 currency code indicating the currency to use * * @throws Exception\InvalidArgumentException * @param string|RowColumn $currencyCode * @return CurrencyFormatter */ public function setCurrencyCode($currencyCode) { if ($currencyCode instanceof RowColumn) { $this->currency_column = $currencyCode->getColumnName(); } elseif (!is_string($currencyCode) || trim($currencyCode) == '') { throw new Exception\InvalidArgumentException(__METHOD__ . " Currency code must be an non empty string (or a RowColumn object)"); } $this->params['currency_code'] = $currencyCode; return $this; }