gadon78921/comment-client-drom

Client to abstract comment service

1.0.2 2021-01-10 09:24 UTC

This package is auto-updated.

Last update: 2024-11-10 17:59:41 UTC


README

Установка

composer require gadon78921/comment-client-drom

Использование

$httpClient = HttpClient::create();
$mapper = new CommentMapper();
$commentApiHttp = new CommentApiHttp($httpClient, $mapper, 'http://example.com');
$response = $commentApiHttp->list($limit, $offset);

Получить список комментариев:

$response = $commentApiHttp->list($limit, $offset);

Добавить комментарий:

$comment = new Comment();
$comment->setName('Ivan');
$comment->setText('Comment_text');
$response = $commentApiHttp->add($comment);

Обновить комментарий:

$comment = new Comment();
$comment->setId(5);
$comment->setName('Ivan');
$comment->setText('Comment_text');
$response = $commentApiHttp->update($comment);