setDijitParam('currency', (string) $currency); return $this; } /** * Retrieve currency * * @return string|null */ public function getCurrency() { return $this->getDijitParam('currency'); } /** * Set currency symbol * * Casts to string, uppercases, and trims to three characters. * * @param string $symbol * @return Zend_Dojo_Form_Element_CurrencyTextBox */ public function setSymbol($symbol) { $symbol = strtoupper((string) $symbol); $length = strlen($symbol); if (3 > $length) { #require_once 'Zend/Form/Element/Exception.php'; throw new Zend_Form_Element_Exception('Invalid symbol provided; please provide ISO 4217 alphabetic currency code'); } if (3 < $length) { $symbol = substr($symbol, 0, 3); } $this->setConstraint('symbol', $symbol); return $this; } /** * Retrieve symbol * * @return string|null */ public function getSymbol() { return $this->getConstraint('symbol'); } /** * Set whether currency is fractional * * @param bool $flag * @return Zend_Dojo_Form_Element_CurrencyTextBox */ public function setFractional($flag) { $this->setConstraint('fractional', (bool) $flag); return $this; } /** * Get whether or not to present fractional values * * @return bool */ public function getFractional() { return ('true' == $this->getConstraint('fractional')); } }