53 lines
1.2 KiB
PHP
53 lines
1.2 KiB
PHP
|
<?php
|
||
|
namespace Misuzu\Emoticons;
|
||
|
|
||
|
use Stringable;
|
||
|
use Index\Data\IDbResult;
|
||
|
|
||
|
class EmoteInfo implements Stringable {
|
||
|
private string $id;
|
||
|
private int $order;
|
||
|
private int $rank;
|
||
|
private string $url;
|
||
|
private array $strings;
|
||
|
|
||
|
public function __construct(IDbResult $result, array $strings = []) {
|
||
|
$this->id = (string)$result->getInteger(0);
|
||
|
$this->order = $result->getInteger(1);
|
||
|
$this->rank = $result->getInteger(2);
|
||
|
$this->url = $result->getString(3);
|
||
|
$this->strings = $strings;
|
||
|
}
|
||
|
|
||
|
public function getId(): string {
|
||
|
return $this->id;
|
||
|
}
|
||
|
|
||
|
public function getOrder(): int {
|
||
|
return $this->order;
|
||
|
}
|
||
|
|
||
|
public function getMinRank(): int {
|
||
|
return $this->rank;
|
||
|
}
|
||
|
|
||
|
public function getUrl(): string {
|
||
|
return $this->url;
|
||
|
}
|
||
|
|
||
|
public function getStrings(): array {
|
||
|
return $this->strings;
|
||
|
}
|
||
|
|
||
|
public function getStringsRaw(): array {
|
||
|
$strings = [];
|
||
|
foreach($this->strings as $info)
|
||
|
$strings[] = $info->getString();
|
||
|
return $strings;
|
||
|
}
|
||
|
|
||
|
public function __toString(): string {
|
||
|
return $this->url;
|
||
|
}
|
||
|
}
|