public function setCurrency($currency) { if (!in_array($currency, $this->allowedCurrency)) { throw new InvalidArgumentException('Not supported currency "' . $currency . '".'); } $this->currency = (string) $currency; return $this; }