misuzu/src/Comments/CommentsPostVoteInfo.php

20 lines
534 B
PHP

<?php
namespace Misuzu\Comments;
use Index\Db\DbResult;
class CommentsPostVoteInfo {
public function __construct(
public private(set) string $commentId,
public private(set) string $userId,
public private(set) int $weight
) {}
public static function fromResult(DbResult $result): CommentsPostVoteInfo {
return new CommentsPostVoteInfo(
commentId: $result->getString(0),
userId: $result->getString(1),
weight: $result->getInteger(2),
);
}
}