From 4ce61e5af70502d12489f262d788bb687bd4b400 Mon Sep 17 00:00:00 2001 From: Netkas Date: Thu, 27 Apr 2023 16:17:36 -0400 Subject: [PATCH] Added new methods to \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent - \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::setTitle - \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::setDescription - \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::setPayload - \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::setProviderToken - \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::setCurrency - \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::addPrice - \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::clearPrices - \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::setMaxTipAmount - \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::setSuggestionsTipAmounts - \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::setProviderData - \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::setPhotoUrl - \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::setPhotoSize - \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::setPhotoWidth - \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::setPhotoHeight - \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::setNeedName - jetbrains://php-storm/navigate/reference?project=tgbot&fqn=\TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::setNeedPhoneNumber - \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::setNeedEmail - \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::setNeedShippingAddress - \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::setSendPhoneNumberToProvider - \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::setSendEmailToProvider - \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::setIsFlexible Renamed \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::isIsFlexible to \TgBotLib\Objects\Telegram\InputMessageContent\InputInvoiceMessageContent::isFlexible https://git.n64.cc/nosial/libs/tgbot/-/issues/3 --- src/TgBotLib/Objects/Currency.php | 200 ++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 src/TgBotLib/Objects/Currency.php diff --git a/src/TgBotLib/Objects/Currency.php b/src/TgBotLib/Objects/Currency.php new file mode 100644 index 0000000..b56cb30 --- /dev/null +++ b/src/TgBotLib/Objects/Currency.php @@ -0,0 +1,200 @@ +code; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @return string + */ + public function getSymbol(): string + { + return $this->symbol; + } + + /** + * @return string + */ + public function getNative(): string + { + return $this->native; + } + + /** + * @return string + */ + public function getThousandsSep(): string + { + return $this->thousands_sep; + } + + /** + * @return string + */ + public function getDecimalSep(): string + { + return $this->decimal_sep; + } + + /** + * @return bool + */ + public function isSymbolLeft(): bool + { + return $this->symbol_left; + } + + /** + * @return bool + */ + public function isSpaceBetween(): bool + { + return $this->space_between; + } + + /** + * @return int + */ + public function getExp(): int + { + return $this->exp; + } + + /** + * @return string + */ + public function getMinAmount(): string + { + return $this->min_amount; + } + + /** + * @return string + */ + public function getMaxAmount(): string + { + return $this->max_amount; + } + + /** + * Returns an array representation of the object + * + * @return array + */ + public function toArray(): array + { + return [ + 'code' => $this->code, + 'title' => $this->title, + 'symbol' => $this->symbol, + 'native' => $this->native, + 'thousands_sep' => $this->thousands_sep, + 'decimal_sep' => $this->decimal_sep, + 'symbol_left' => $this->symbol_left, + 'space_between' => $this->space_between, + 'exp' => $this->exp, + 'min_amount' => $this->min_amount, + 'max_amount' => $this->max_amount, + ]; + } + + /** + * Constructs the object from an array representation + * + * @param array $data + * @return ObjectTypeInterface + */ + public static function fromArray(array $data): ObjectTypeInterface + { + $object = new self(); + + $object->code = $data['code'] ?? null; + $object->title = $data['title'] ?? null; + $object->symbol = $data['symbol'] ?? null; + $object->native = $data['native'] ?? null; + $object->thousands_sep = $data['thousands_sep'] ?? null; + $object->decimal_sep = $data['decimal_sep'] ?? null; + $object->symbol_left = $data['symbol_left'] ?? null; + $object->space_between = $data['space_between'] ?? null; + $object->exp = $data['exp'] ?? null; + $object->min_amount = $data['min_amount'] ?? null; + $object->max_amount = $data['max_amount'] ?? null; + + return $object; + } + } \ No newline at end of file