misuzu/src/Emoticons/EmoteStringInfo.php

38 lines
831 B
PHP
Raw Normal View History

<?php
namespace Misuzu\Emoticons;
use Stringable;
2024-10-05 02:40:29 +00:00
use Index\Db\DbResult;
class EmoteStringInfo implements Stringable {
2024-02-07 00:04:45 +00:00
public function __construct(
private string $emoteId,
private int $order,
private string $string,
) {}
2024-10-05 02:40:29 +00:00
public static function fromResult(DbResult $result): EmoteStringInfo {
2024-02-07 00:04:45 +00:00
return new EmoteStringInfo(
emoteId: $result->getString(0),
order: $result->getInteger(1),
string: $result->getString(2),
);
}
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;
}
}