Files
amikhaylov e90314f18b Added VKBot
2026-05-28 02:16:26 +03:00

37 lines
858 B
PHP

<?php
declare(strict_types=1);
namespace App\Library\VK\Resources;
use App\Library\VK\VkApiClient;
class WallResource
{
public function __construct(private VkApiClient $api) {}
public function get(string $domain, int $count = 50, int $offset = 0): array
{
$result = $this->api->call('wall.get', [
'domain' => $domain,
'offset' => $offset,
'count' => $count,
'copy_history_depth' => 10
]);
return $result['response'] ?? [ 'count' => 0, 'items' => [] ];
}
// id = '-93243530_2113'
public function getById(string $id): array
{
$result = $this->api->call('wall.getById',
[
'posts' => [ $id ],
'copy_history_depth' => 10
]);
return $result['response'] ?? [ 'items' => [] ];
}
}