mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-01-16 18:04:34 -05:00
28 lines
720 B
PHP
28 lines
720 B
PHP
<?php
|
|
|
|
namespace Gazelle\Json;
|
|
|
|
class News extends \Gazelle\Json {
|
|
public function __construct(
|
|
protected int $limit,
|
|
protected int $offset,
|
|
) {}
|
|
|
|
public function payload(): array {
|
|
\Text::$TOC = true;
|
|
return [
|
|
'items' => array_map(
|
|
fn($r) => [
|
|
$r['id'],
|
|
\Text::full_format($r['title']),
|
|
time_diff($r['created']),
|
|
\Text::full_format($r['body']),
|
|
$r['created'],
|
|
time_diff($r['created'], 2, false),
|
|
],
|
|
new \Gazelle\Manager\News()->list($this->limit, $this->offset)
|
|
)
|
|
];
|
|
}
|
|
}
|