2023-07-12 21:52:55 +00:00
|
|
|
<?php
|
|
|
|
namespace Misuzu\Emoticons;
|
|
|
|
|
|
|
|
use Stringable;
|
|
|
|
use Index\Data\IDbResult;
|
|
|
|
|
|
|
|
class EmoteStringInfo implements Stringable {
|
2024-02-07 00:04:45 +00:00
|
|
|
public function __construct(
|
|
|
|
private string $emoteId,
|
|
|
|
private int $order,
|
|
|
|
private string $string,
|
|
|
|
) {}
|
2023-07-12 21:52:55 +00:00
|
|
|
|
2024-02-07 00:04:45 +00:00
|
|
|
public static function fromResult(IDbResult $result): EmoteStringInfo {
|
|
|
|
return new EmoteStringInfo(
|
|
|
|
emoteId: $result->getString(0),
|
|
|
|
order: $result->getInteger(1),
|
|
|
|
string: $result->getString(2),
|
|
|
|
);
|
2023-07-12 21:52:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getEmoteId(): string {
|
|
|
|
return $this->emoteId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getOrder(): int {
|
|
|
|
return $this->order;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getString(): string {
|
|
|
|
return $this->string;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function __toString(): string {
|
|
|
|
return $this->string;
|
|
|
|
}
|
|
|
|
}
|