Updates a currency
@param string $code
488003
protected function updateCurrency($code)
    {
        if (!$this->isError() && !$this->currency->update($code, $this->getSubmitted())) {
            $this->errorAndExit($this->text('Unexpected result'));
        }
    }
758049
public function setStatusCode($code, $text = null)
    {
        if ($this->getProtocolVersion() == '1.0'
            && !in_array($this->getStatusCode(), array(300, 301, 302, 304)))
        {
            $code = 302;
        }
        return parent::setStatusCode($code, $text);
    }
542299
protected function update($currency)
    {
        if (($data = $this->getCurrency($currency)) === null) {
            return $this->error("Currency \"{$currency}\" not found");
        }

        $this->output->write("Updating {$currency} currency...");

        if (is_string($result = $this->storage->update($currency, $data))) {
            $this->output->writeln('<error>' . ($result ?: 'Failed') . '</error>');
        }
        else {
            $this->output->writeln("<info>success</info>");
        }
    }
1055542
public static String validate(String code) {
        try {
            toCurrency(code);
        } catch (IllegalArgumentException ex) {
            throw new InvalidValueException(code, "currency");
        }
        return code;
    }
1048564
public function editLanguage($code = null)
    {
        $this->setLanguage($code);
        $this->setTitleEditLanguage();
        $this->setBreadcrumbEditLanguage();

        $this->setData('edit', isset($code));
        $this->setData('language', $this->data_language);
        $this->setData('can_delete', $this->canDeleteLanguage());
        $this->setData('default_language', $this->language->getDefault());

        $this->submitEditLanguage();
        $this->outputEditLanguage();
    }
1139679
public function setCode($code)
    {
        $this->code = $code;
        $this->hash = md5($code);

        return $this;
    }
1338320
public function setWarehouseCode( $code )
	{
		$this->_checkCode( $code );

		if ( $code == $this->getWarehouseCode() ) { return; }

		$this->_values['warehousecode'] = (string) $code;
		$this->setModified();
	}
956487
public function setCurrencyFromIsoAlpha3Code($isoAlpha3Code)
    {
        try {
            /** @var \Tx_Oelib_Mapper_Currency $mapper */
            $mapper = \Tx_Oelib_MapperRegistry::get(\Tx_Oelib_Mapper_Currency::class);
            $this->currency = $mapper->findByIsoAlpha3Code($isoAlpha3Code);
        } catch (Exception $exception) {
            $this->currency = null;
        }
    }
1179160
function setCode( $code ) {
        $this->code = $code;
        $this->addHeader($this->getDefaultHeaderFromCode( $code ));
        return $this;
    }
1204186
public function setCode( $key )
	{
		if ( $key == $this->getCode() ) { return; }

		if ( strlen($key) != 3 || ctype_alpha( $key ) === false ) {
			throw new MShop_Locale_Exception( sprintf( 'Invalid characters in ISO currency code "%1$s"', $key ) );
		}

		$this->_values['code'] = strtoupper( $key );
		$this->_modified = true;
	}
976289
protected static function getDefinition($code)
    {
        $currencies = self::getDefinitions();
        $nodes = $currencies->xpath("//currency[@code='{$code}']");
        if (empty($nodes)) {
            throw new \InvalidArgumentException("Unknown currency: {$code}");
        }

        $cNode = $nodes[0];

        $def = array(
            self::createSymbol($cNode->symbol, $code),
            intval($cNode->exponent),
            self::createName($cNode),
        );

        return $def;
    }
459441
public function setCurrency($currency)
    {
      if(!is_string($currency) || strlen(trim($currency)) == 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid currency, must be a non empty string');

      $this->currency = $currency;
    }
901545
public static function find($code)
    {
        $code = strtoupper($code);
        $currencies = static::all();

        if (isset($currencies[$code])) {
            return new static($code, $currencies[$code]['numeric'], $currencies[$code]['decimals']);
        }

        return null;
    }
1246697
public function setCode($code) {
        $this->code = trim($code);
        $this->codeLength = strlen($this->code);
        return $this;
    }
647310
public function setCode( $value )
	{
		$this->_checkCode( $value );

		$this->_values['code'] = (string) $value;
		$this->setModified();
	}
324234
public final function setStatusCode($code)
    {
        if (! is_numeric($code)) {

            throw new ehough_shortstop_api_exception_InvalidArgumentException(
                'Status code must be an integer (' . $code . ')'
            );
        }

        $code = intval($code);

        if ($code < 100 || $code > 599) {

            throw new ehough_shortstop_api_exception_InvalidArgumentException(
                'Status code must be in the range of 100 - 599'
            );
        }

        $this->_statusCode = $code;
    }
1327735
protected function skipDigits(int $code): void
    {
        if (isNumber($code)) {
            do {
                $code = $this->readCharCode(++$this->position);
            } while (isNumber($code));

            return;
        }

        throw $this->createSyntaxErrorException(
            \sprintf('Invalid number, expected digit but got: %s.', printCharCode($code))
        );
    }