misuzu/src/Emoticons/EmoteInfo.php

28 lines
683 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 EmoteInfo implements Stringable {
2024-02-07 00:04:45 +00:00
public function __construct(
public private(set) string $id,
public private(set) int $order,
public private(set) int $minRank,
public private(set) string $url,
2024-02-07 00:04:45 +00:00
) {}
2024-10-05 02:40:29 +00:00
public static function fromResult(DbResult $result): EmoteInfo {
2024-02-07 00:04:45 +00:00
return new EmoteInfo(
id: $result->getString(0),
order: $result->getInteger(1),
minRank: $result->getInteger(2),
2024-02-07 00:04:45 +00:00
url: $result->getString(3),
);
}
public function __toString(): string {
return $this->url;
}
}