25 lines
633 B
PHP
25 lines
633 B
PHP
<?php
|
|
namespace Misuzu\Emoticons;
|
|
|
|
use Stringable;
|
|
use Index\Db\DbResult;
|
|
|
|
class EmoteStringInfo implements Stringable {
|
|
public function __construct(
|
|
public private(set) string $emoteId,
|
|
public private(set) int $order,
|
|
public private(set) string $string,
|
|
) {}
|
|
|
|
public static function fromResult(DbResult $result): EmoteStringInfo {
|
|
return new EmoteStringInfo(
|
|
emoteId: $result->getString(0),
|
|
order: $result->getInteger(1),
|
|
string: $result->getString(2),
|
|
);
|
|
}
|
|
|
|
public function __toString(): string {
|
|
return $this->string;
|
|
}
|
|
}
|