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
This commit is contained in:
parent
26c0a197dc
commit
b8d3a20a5c
1 changed files with 200 additions and 0 deletions
200
src/TgBotLib/Objects/Currency.php
Normal file
200
src/TgBotLib/Objects/Currency.php
Normal file
|
@ -0,0 +1,200 @@
|
|||
<?php
|
||||
|
||||
/** @noinspection PhpMissingFieldTypeInspection */
|
||||
|
||||
namespace TgBotLib\Objects;
|
||||
|
||||
use TgBotLib\Interfaces\ObjectTypeInterface;
|
||||
|
||||
class Currency implements ObjectTypeInterface
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $code;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $title;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $symbol;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $native;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $thousands_sep;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $decimal_sep;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $symbol_left;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $space_between;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $exp;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $min_amount;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $max_amount;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCode(): string
|
||||
{
|
||||
return $this->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;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue