38 lines
835 B
PHP
38 lines
835 B
PHP
<?php
|
|
namespace Misuzu\Emoticons;
|
|
|
|
use Stringable;
|
|
use Index\Data\IDbResult;
|
|
|
|
class EmoteStringInfo implements Stringable {
|
|
public function __construct(
|
|
private string $emoteId,
|
|
private int $order,
|
|
private string $string,
|
|
) {}
|
|
|
|
public static function fromResult(IDbResult $result): EmoteStringInfo {
|
|
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;
|
|
}
|
|
}
|