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